Index: third_party/WebKit/LayoutTests/device_orientation/motion/optional-event-properties.html |
diff --git a/third_party/WebKit/LayoutTests/device_orientation/motion/optional-event-properties.html b/third_party/WebKit/LayoutTests/device_orientation/motion/optional-event-properties.html |
index ff941ca5a557b7f5be99a27d9a4f5945107deec0..67ec6e3c4343a667ad66e65c88bacb7c49007f48 100644 |
--- a/third_party/WebKit/LayoutTests/device_orientation/motion/optional-event-properties.html |
+++ b/third_party/WebKit/LayoutTests/device_orientation/motion/optional-event-properties.html |
@@ -24,7 +24,7 @@ shouldBeTrue("event.accelerationIncludingGravity == null"); |
shouldBeTrue("event.rotationRate == null"); |
shouldBeTrue("event.interval == null"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: {x: 0, y: 1, z: 2}, accelerationIncludingGravity: {x: 3, y: 4, z: 5}, rotationRate: {alpha: 6, beta: 7, gamma: 8}, interval: 9})"); |
shouldBeTrue("event.acceleration.x == 0"); |
shouldBeTrue("event.acceleration.y == 1"); |
shouldBeTrue("event.acceleration.z == 2"); |
@@ -36,15 +36,15 @@ shouldBeTrue("event.rotationRate.beta == 7"); |
shouldBeTrue("event.rotationRate.gamma == 8"); |
shouldBeTrue("event.interval == 9"); |
-testException("event.initDeviceMotionEvent('', false, false, objectThrowingException, {x: 3, z: 5}, {gamma: 8, beta: 7}, 9)", "Error: x getter exception"); |
-testException("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, objectThrowingException, {gamma: 8, beta: 7}, 9)", "Error: x getter exception"); |
-testException("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, z: 5}, objectThrowingException, 9)", "Error: alpha getter exception"); |
+testException("event = new DeviceMotionEvent('', {acceleration: objectThrowingException, accelerationIncludingGravity: {x: 3, z: 5}, rotationRate: {gamma: 8, beta: 7}, interval: 9})", "Error: x getter exception"); |
+testException("event = new DeviceMotionEvent('', {acceleration: {x: 0, y: 1, z: 2}, accelerationIncludingGravity: objectThrowingException, rotationRate: {gamma: 8, beta: 7}, interval: 9})", "Error: x getter exception"); |
+testException("event = new DeviceMotionEvent('', {acceleration: {x: 0, y: 1, z: 2}, accelerationIncludingGravity: {x: 3, z: 5}, rotationRate: objectThrowingException, interval: 9})", "Error: alpha getter exception"); |
-testException("event.initDeviceMotionEvent('', false, false, {x: objectThrowingException, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)", "Error: valueOf threw exception"); |
-testException("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: objectThrowingException, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)", "Error: valueOf threw exception"); |
-testException("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: objectThrowingException}, 9)", "Error: valueOf threw exception"); |
+testException("event = new DeviceMotionEvent('', {acceleration: {x: objectThrowingException, y: 1, z: 2}, accelerationIncludingGravity: {x: 3, y: 4, z: 5}, rotationRate: {alpha: 6, beta: 7, gamma: 8}, interval: 9})", "Error: valueOf threw exception"); |
+testException("event = new DeviceMotionEvent('', {acceleration: {x: 0, y: 1, z: 2}, accelerationIncludingGravity: {x: 3, y: objectThrowingException, z: 5}, rotationRate: {alpha: 6, beta: 7, gamma: 8}, interval: 9})", "Error: valueOf threw exception"); |
+testException("event = new DeviceMotionEvent('', {acceleration: {x: 0, y: 1, z: 2}, accelerationIncludingGravity: {x: 3, y: 4, z: 5}, rotationRate: {alpha: 6, beta: 7, gamma: objectThrowingException}, interval: 9})", "Error: valueOf threw exception"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, {y: 1, x: 0}, {x: 3, z: 5}, {gamma: 8, beta: 7}, 9)"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: {y: 1, x: 0}, accelerationIncludingGravity: {x: 3, z: 5}, rotationRate: {gamma: 8, beta: 7}, interval: 9})"); |
shouldBeTrue("event.acceleration.x == 0"); |
shouldBeTrue("event.acceleration.y == 1"); |
shouldBeTrue("event.acceleration.z == null"); |
@@ -56,43 +56,51 @@ shouldBeTrue("event.rotationRate.beta == 7"); |
shouldBeTrue("event.rotationRate.gamma == 8"); |
shouldBeTrue("event.interval == 9"); |
-evalAndLog("event.initDeviceMotionEvent()"); |
+evalAndLog("event = new DeviceMotionEvent('')"); |
shouldBeTrue("event.acceleration == null"); |
shouldBeTrue("event.accelerationIncludingGravity == null"); |
shouldBeTrue("event.rotationRate == null"); |
shouldBeTrue("event.interval == null"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, [], [], [], [])"); |
-shouldBeTrue("event.acceleration == null"); |
-shouldBeTrue("event.accelerationIncludingGravity == null"); |
-shouldBeTrue("event.rotationRate == null"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: [], accelerationIncludingGravity: [], rotationRate: [], interval: []})"); |
+shouldBeTrue("event.acceleration.x == null"); |
+shouldBeTrue("event.acceleration.y == null"); |
+shouldBeTrue("event.acceleration.z == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.x == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.y == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.z == null"); |
+shouldBeTrue("event.rotationRate.alpha == null"); |
+shouldBeTrue("event.rotationRate.beta == null"); |
+shouldBeTrue("event.rotationRate.gamma == null"); |
shouldBeTrue("event.interval == 0"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined)"); |
-shouldBeTrue("event.acceleration == null"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: [], accelerationIncludingGravity: undefined, rotationRate: undefined, interval: undefined})"); |
+shouldBeTrue("event.acceleration.x == null"); |
+shouldBeTrue("event.acceleration.y == null"); |
+shouldBeTrue("event.acceleration.z == null"); |
shouldBeTrue("event.accelerationIncludingGravity == null"); |
shouldBeTrue("event.rotationRate == null"); |
shouldBeTrue("event.interval == null"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, '', '', '', '')"); |
-shouldBeTrue("event.acceleration == null"); |
-shouldBeTrue("event.accelerationIncludingGravity == null"); |
-shouldBeTrue("event.rotationRate == null"); |
-shouldBeTrue("event.interval == 0"); |
- |
-evalAndLog("event.initDeviceMotionEvent('', false, false, null, null, null, null)"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: null, accelerationIncludingGravity: null, rotationRate: null, interval: null})"); |
shouldBeTrue("event.acceleration == null"); |
shouldBeTrue("event.accelerationIncludingGravity == null"); |
shouldBeTrue("event.rotationRate == null"); |
shouldBeTrue("event.interval == null"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, {x: null, y: null, z: null}, {x: null, y: null, z: null}, {alpha: null, beta: null, gamma: null}, null)"); |
-shouldBeTrue("event.acceleration == null"); |
-shouldBeTrue("event.accelerationIncludingGravity == null"); |
-shouldBeTrue("event.rotationRate == null"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: {x: null, y: null, z: null}, accelerationIncludingGravity: {x: null, y: null, z: null}, rotationRate: {alpha: null, beta: null, gamma: null}, interval: null})"); |
+shouldBeTrue("event.acceleration.x == null"); |
+shouldBeTrue("event.acceleration.y == null"); |
+shouldBeTrue("event.acceleration.z == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.x == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.y == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.z == null"); |
+shouldBeTrue("event.rotationRate.alpha == null"); |
+shouldBeTrue("event.rotationRate.beta == null"); |
+shouldBeTrue("event.rotationRate.gamma == null"); |
shouldBeTrue("event.interval == null"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, {x: null, y: null, z: 1}, {x: null, y: null, z: 2}, {alpha: null, beta: null, gamma: 3}, null)"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: {x: null, y: null, z: 1}, accelerationIncludingGravity: {x: null, y: null, z: 2}, rotationRate: {alpha: null, beta: null, gamma: 3}, interval: null})"); |
shouldBeTrue("event.acceleration.x == null"); |
shouldBeTrue("event.acceleration.y == null"); |
shouldBeTrue("event.acceleration.z == 1"); |
@@ -104,13 +112,19 @@ shouldBeTrue("event.rotationRate.beta == null"); |
shouldBeTrue("event.rotationRate.gamma == 3"); |
shouldBeTrue("event.interval == null"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, {x: undefined, y: undefined, z: undefined}, {x: undefined, y: undefined, z: undefined}, {alpha: undefined, beta: undefined, gamma: undefined}, undefined)"); |
-shouldBeTrue("event.acceleration == null"); |
-shouldBeTrue("event.accelerationIncludingGravity == null"); |
-shouldBeTrue("event.rotationRate == null"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: {x: undefined, y: undefined, z: undefined}, accelerationIncludingGravity: {x: undefined, y: undefined, z: undefined}, rotationRate: {alpha: undefined, beta: undefined, gamma: undefined}, interval: undefined})"); |
+shouldBeTrue("event.acceleration.x == null"); |
+shouldBeTrue("event.acceleration.y == null"); |
+shouldBeTrue("event.acceleration.z == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.x == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.y == null"); |
+shouldBeTrue("event.accelerationIncludingGravity.z == null"); |
+shouldBeTrue("event.rotationRate.alpha == null"); |
+shouldBeTrue("event.rotationRate.beta == null"); |
+shouldBeTrue("event.rotationRate.gamma == null"); |
shouldBeTrue("event.interval == null"); |
-evalAndLog("event.initDeviceMotionEvent('', false, false, {x: undefined, y: undefined, z: 1}, {x: undefined, y: undefined, z: 2}, {alpha: undefined, beta: undefined, gamma: 3}, undefined)"); |
+evalAndLog("event = new DeviceMotionEvent('', {acceleration: {x: undefined, y: undefined, z: 1}, accelerationIncludingGravity: {x: undefined, y: undefined, z: 2}, rotationRate: {alpha: undefined, beta: undefined, gamma: 3}, interval: undefined})"); |
shouldBeTrue("event.acceleration.x == null"); |
shouldBeTrue("event.acceleration.y == null"); |
shouldBeTrue("event.acceleration.z == 1"); |