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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/multiple-event-listeners.html

Issue 1737443002: Make DeviceOrientationEvent.prototype.absolute non-nullable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address feedback Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../resources/js-test.js"></script> 3 <script src="../../../resources/js-test.js"></script>
4 </head> 4 </head>
5 <body> 5 <body>
6 <script> 6 <script>
7 7
8 description('Tests using multiple event handlers for the Device Orientation API. '); 8 description('Tests using multiple event handlers for the Device Orientation API. ');
9 9
10 var mockEvent; 10 var mockEvent;
11 var expectedEvent; 11 var expectedEvent;
12 function setMockOrientation(alpha, beta, gamma, absolute) { 12 function setMockOrientation(alpha, beta, gamma, absolute) {
13 mockEvent = {alpha: alpha, beta: beta, gamma: gamma, absolute: absolute}; 13 mockEvent = {alpha: alpha, beta: beta, gamma: gamma, absolute: absolute};
14 if (window.testRunner) 14 if (window.testRunner)
15 testRunner.setMockDeviceOrientation( 15 testRunner.setMockDeviceOrientation(
16 true, mockEvent.alpha, true, mockEvent.beta, true, mockEvent.gamma, true, mockEvent.absolute); 16 true, mockEvent.alpha, true, mockEvent.beta, true, mockEvent.gamma, mockEvent.absolute);
17 else 17 else
18 debug('This test can not be run without the TestRunner'); 18 debug('This test can not be run without the TestRunner');
19 } 19 }
20 20
21 var deviceOrientationEvent; 21 var deviceOrientationEvent;
22 function checkOrientation(event) { 22 function checkOrientation(event) {
23 deviceOrientationEvent = event; 23 deviceOrientationEvent = event;
24 shouldBe('deviceOrientationEvent.alpha', 'expectedEvent.alpha'); 24 shouldBe('deviceOrientationEvent.alpha', 'expectedEvent.alpha');
25 shouldBe('deviceOrientationEvent.beta', 'expectedEvent.beta'); 25 shouldBe('deviceOrientationEvent.beta', 'expectedEvent.beta');
26 shouldBe('deviceOrientationEvent.gamma', 'expectedEvent.gamma'); 26 shouldBe('deviceOrientationEvent.gamma', 'expectedEvent.gamma');
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 setMockOrientation(1, 2, 3, true); 79 setMockOrientation(1, 2, 3, true);
80 expectedEvent = mockEvent; 80 expectedEvent = mockEvent;
81 window.addEventListener('deviceorientation', firstListener); 81 window.addEventListener('deviceorientation', firstListener);
82 window.addEventListener('deviceorientation', secondListener); 82 window.addEventListener('deviceorientation', secondListener);
83 83
84 window.jsTestIsAsync = true; 84 window.jsTestIsAsync = true;
85 85
86 </script> 86 </script>
87 </body> 87 </body>
88 </html> 88 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698