Backed out changeset 7e3f9a865413 (bug 1311802) for failing browser/base/content/test/static/browser_parsable_css.js. r=backout

This commit is contained in:
Sebastian Hengst 2017-03-31 10:08:21 +02:00
Родитель cb6b27aed8
Коммит 2374426ebe
7 изменённых файлов: 68 добавлений и 4 удалений

Просмотреть файл

@ -30,6 +30,7 @@ VRMockDisplay::VRMockDisplay(const nsCString& aID, uint32_t aDeviceID)
: mDeviceID(aDeviceID)
, mTimestamp(TimeStamp::Now())
{
mSensorState.Clear();
mDisplayInfo.mDisplayName = aID;
mDisplayInfo.mType = VRDeviceType::Puppet;
mDisplayInfo.mIsConnected = true;
@ -348,4 +349,4 @@ VRServiceTest::AttachVRController(const nsAString& aID, ErrorResult& aRv)
}
} // namespace dom
} // namespace mozilla
} // namespace mozilla

Просмотреть файл

@ -27,6 +27,7 @@ public:
void SetPose(const Nullable<Float32Array>& aPosition, const Nullable<Float32Array>& aLinearVelocity,
const Nullable<Float32Array>& aLinearAcceleration, const Nullable<Float32Array>& aOrientation,
const Nullable<Float32Array>& aAngularVelocity, const Nullable<Float32Array>& aAngularAcceleration);
void SetMountState(bool aIsMounted) { mDisplayInfo.mIsMounted = aIsMounted; }
void Update();
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
@ -84,4 +85,4 @@ private:
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_VRServiceTest_h_
#endif // mozilla_dom_VRServiceTest_h_

Просмотреть файл

@ -33,6 +33,10 @@ var SetEyeParameter = function(eye, offsetX, offsetY, offsetZ,
downDegree, leftDegree);
}
var SetMountState = function(isMounted) {
vrMockDisplay.setMountState(isMounted);
}
var UpdateVRDisplay = function() {
vrMockDisplay.update();
}
@ -42,6 +46,7 @@ var API = {
SetVRDisplayPose: SetVRDisplayPose,
SetEyeResolution: SetEyeResolution,
SetEyeParameter: SetEyeParameter,
SetMountState: SetMountState,
UpdateVRDisplay: UpdateVRDisplay,
none: false

Просмотреть файл

@ -5,7 +5,8 @@ support-files =
runVRTest.js
WebVRHelpers.js
[test_vrDisplay_getFrameData.html]
[test_vrDisplay_exitPresent.html]
[test_vrDisplay_getFrameData.html]
[test_vrDisplay_onvrdisplaydeactivate_crosscontent.html]
[test_vrDisplay_requestPresent.html]
skip-if = true

Просмотреть файл

@ -0,0 +1,54 @@
<html>
<head>
<title>VRDisplay onvrdisplaydeactivate Crosscontent test</title>
<meta name="timeout" content="long"/>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="VRSimulationDriver.js"></script>
<script src="WebVRHelpers.js"></script>
<script src="requestPresent.js"></script>
<script src="runVRTest.js"></script>
</head>
<body>
<canvas id="vrCanvas"></canvas>
<script>
function startTest() {
var canvas = document.getElementById("vrCanvas");
var iframe1 = document.getElementById("iframe1").contentWindow;
var t = async_test("vrdisplaydeactivate crosscontent test");
window.addEventListener("vrdisplaydeactivate", () => {
t.step(() => {
assert_true(vrDisplay.isPresenting,
"VRDisplay should be still presenting now without being affected by the event.");
t.done();
});
});
iframe1.addEventListener("vrdisplaydeactivate", () => {
t.unreached_func("vrdisplaydeactivate should not be received by other iframe.");
});
promise_test((test) => {
return attachVRDisplay(test).then(() => {
return promise_test((test) => {
return setupVRDisplay(test).then(() => {
VRSimulationDriver.SetMountState(true);
VRSimulationDriver.UpdateVRDisplay();
return WebVRHelpers.RequestPresentOnVRDisplay(vrDisplay, [{source: canvas}]);
}).then(() => {
VRSimulationDriver.SetMountState(false);
VRSimulationDriver.UpdateVRDisplay();
});
});
});
});
}
runVRTest(startTest);
</script>
<iframe id="iframe1"></iframe>
</body>
</html>

Просмотреть файл

@ -15,6 +15,7 @@ interface VRMockDisplay {
void setPose(Float32Array? position, Float32Array? linearVelocity,
Float32Array? linearAcceleration, Float32Array? orientation,
Float32Array? angularVelocity, Float32Array? angularAcceleration);
void setMountState(boolean isMounted);
void update();
};

Просмотреть файл

@ -120,8 +120,9 @@ VRDisplayPuppet::~VRDisplayPuppet()
void
VRDisplayPuppet::SetDisplayInfo(const VRDisplayInfo& aDisplayInfo)
{
// We are only interested in the eye info of the display info.
// We are only interested in the eye and mount info of the display info.
mDisplayInfo.mEyeResolution = aDisplayInfo.mEyeResolution;
mDisplayInfo.mIsMounted = aDisplayInfo.mIsMounted;
memcpy(&mDisplayInfo.mEyeFOV, &aDisplayInfo.mEyeFOV,
sizeof(mDisplayInfo.mEyeFOV[0]) * VRDisplayInfo::NumEyes);
memcpy(&mDisplayInfo.mEyeTranslation, &aDisplayInfo.mEyeTranslation,