Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/DeviceMotion/add-during-dispatch.html

Issue 2677603003: Move DeviceMotion and DeviceOrientation out from fast/dom/. (Closed)
Patch Set: device_orientation Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/DeviceMotion/add-during-dispatch.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceMotion/add-during-dispatch.html b/third_party/WebKit/LayoutTests/fast/dom/DeviceMotion/add-during-dispatch.html
deleted file mode 100644
index 36fa543e7164812471365e8643d3f914afdf2b24..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/dom/DeviceMotion/add-during-dispatch.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="../../../resources/js-test.js"></script>
-<script>
-description('Test no fire listeners added during event dispatch.');
-
-var mockEvent;
-function setMockMotion(accelerationX, accelerationY, accelerationZ,
- accelerationIncludingGravityX, accelerationIncludingGravityY, accelerationIncludingGravityZ,
- rotationRateAlpha, rotationRateBeta, rotationRateGamma,
- interval) {
-
- mockEvent = {accelerationX: accelerationX, accelerationY: accelerationY, accelerationZ: accelerationZ,
- accelerationIncludingGravityX: accelerationIncludingGravityX, accelerationIncludingGravityY: accelerationIncludingGravityY, accelerationIncludingGravityZ: accelerationIncludingGravityZ,
- rotationRateAlpha: rotationRateAlpha, rotationRateBeta: rotationRateBeta, rotationRateGamma: rotationRateGamma,
- interval: interval};
-
- if (window.testRunner)
- testRunner.setMockDeviceMotion(null != mockEvent.accelerationX, null == mockEvent.accelerationX ? 0 : mockEvent.accelerationX,
- null != mockEvent.accelerationY, null == mockEvent.accelerationY ? 0 : mockEvent.accelerationY,
- null != mockEvent.accelerationZ, null == mockEvent.accelerationZ ? 0 : mockEvent.accelerationZ,
- null != mockEvent.accelerationIncludingGravityX, null == mockEvent.accelerationIncludingGravityX ? 0 : mockEvent.accelerationIncludingGravityX,
- null != mockEvent.accelerationIncludingGravityY, null == mockEvent.accelerationIncludingGravityY ? 0 : mockEvent.accelerationIncludingGravityY,
- null != mockEvent.accelerationIncludingGravityZ, null == mockEvent.accelerationIncludingGravityZ ? 0 : mockEvent.accelerationIncludingGravityZ,
- null != mockEvent.rotationRateAlpha, null == mockEvent.rotationRateAlpha ? 0 : mockEvent.rotationRateAlpha,
- null != mockEvent.rotationRateBeta, null == mockEvent.rotationRateBeta ? 0 : mockEvent.rotationRateBeta,
- null != mockEvent.rotationRateGamma, null == mockEvent.rotationRateGamma ? 0 : mockEvent.rotationRateGamma,
- interval);
- else
- debug('This test can not be run without the TestRunner');
-}
-
-
-var deviceMotionEvent;
-function checkMotion(event) {
- deviceMotionEvent = event;
- shouldBe('deviceMotionEvent.acceleration.x', 'mockEvent.accelerationX');
- shouldBe('deviceMotionEvent.acceleration.y', 'mockEvent.accelerationY');
- shouldBe('deviceMotionEvent.acceleration.z', 'mockEvent.accelerationZ');
-
- shouldBe('deviceMotionEvent.accelerationIncludingGravity.x', 'mockEvent.accelerationIncludingGravityX');
- shouldBe('deviceMotionEvent.accelerationIncludingGravity.y', 'mockEvent.accelerationIncludingGravityY');
- shouldBe('deviceMotionEvent.accelerationIncludingGravity.z', 'mockEvent.accelerationIncludingGravityZ');
-
- shouldBe('deviceMotionEvent.rotationRate.alpha', 'mockEvent.rotationRateAlpha');
- shouldBe('deviceMotionEvent.rotationRate.beta', 'mockEvent.rotationRateBeta');
- shouldBe('deviceMotionEvent.rotationRate.gamma', 'mockEvent.rotationRateGamma');
-
- shouldBe('deviceMotionEvent.interval', 'mockEvent.interval');
-}
-
-function firstListener(event) {
- checkMotion(event);
- window.removeEventListener('devicemotion', firstListener);
- window.addEventListener('devicemotion', secondListener);
- setTimeout(function(){finish();}, 100);
-}
-
-var numSecondListenerCalls = 0;
-function secondListener(event) {
- ++numSecondListenerCalls;
-}
-
-function finish() {
- shouldBe('numSecondListenerCalls', '1');
- finishJSTest();
-}
-
-setMockMotion(1, 2, 3,
- 4, 5, 6,
- 7, 8, 9,
- 10);
-window.addEventListener('devicemotion', firstListener);
-
-window.jsTestIsAsync = true;
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698