зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1306493
- Part 5: Make we only have one VRMockDisplay in tests; r=kip
MozReview-Commit-ID: ACIszhHGUiQ --HG-- extra : rebase_source : 66addde807ff29315c903506439eed39b900b52e
This commit is contained in:
Родитель
1785cdc8c9
Коммит
66f6566530
|
@ -45,6 +45,7 @@ VRManagerChild::VRManagerChild()
|
|||
, mFrameRequestCallbackCounter(0)
|
||||
, mBackend(layers::LayersBackend::LAYERS_NONE)
|
||||
, mPromiseID(0)
|
||||
, mVRMockDisplay(nullptr)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
|
@ -519,7 +520,11 @@ VRManagerChild::RecvReplyCreateVRServiceTestDisplay(const nsCString& aID,
|
|||
MOZ_CRASH("We should always have a promise.");
|
||||
}
|
||||
|
||||
p->MaybeResolve(new VRMockDisplay(aID, aDeviceID));
|
||||
// We only allow one VRMockDisplay in VR tests.
|
||||
if (!mVRMockDisplay) {
|
||||
mVRMockDisplay = new VRMockDisplay(aID, aDeviceID);
|
||||
}
|
||||
p->MaybeResolve(mVRMockDisplay);
|
||||
mPromiseList.Remove(aPromiseID);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ class GamepadManager;
|
|||
class Navigator;
|
||||
class VRDisplay;
|
||||
class VREventObserver;
|
||||
class VRMockDisplay;
|
||||
} // namespace dom
|
||||
namespace layers {
|
||||
class TextureClient;
|
||||
|
@ -187,6 +188,7 @@ private:
|
|||
RefPtr<layers::SyncObject> mSyncObject;
|
||||
uint32_t mPromiseID;
|
||||
nsRefPtrHashtable<nsUint32HashKey, dom::Promise> mPromiseList;
|
||||
RefPtr<dom::VRMockDisplay> mVRMockDisplay;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(VRManagerChild);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче