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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/add-listener-from-callback.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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script> 5 <script>
6 description('Tests that adding a new event listener from a callback works as exp ected.'); 6 description('Tests that adding a new event listener from a callback works as exp ected.');
7 7
8 var mockAlpha = 1.1; 8 var mockAlpha = 1.1;
9 var mockBeta = 2.2; 9 var mockBeta = 2.2;
10 var mockGamma = 3.3; 10 var mockGamma = 3.3;
11 var mockAbsolute = true; 11 var mockAbsolute = true;
12 12
13 if (window.testRunner) 13 if (window.testRunner)
14 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m ockGamma, true, mockAbsolute); 14 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m ockGamma, mockAbsolute);
15 else 15 else
16 debug('This test can not be run without the TestRunner'); 16 debug('This test can not be run without the TestRunner');
17 17
18 var deviceOrientationEvent; 18 var deviceOrientationEvent;
19 function checkOrientation(event) { 19 function checkOrientation(event) {
20 deviceOrientationEvent = event; 20 deviceOrientationEvent = event;
21 shouldBe('deviceOrientationEvent.alpha', 'mockAlpha'); 21 shouldBe('deviceOrientationEvent.alpha', 'mockAlpha');
22 shouldBe('deviceOrientationEvent.beta', 'mockBeta'); 22 shouldBe('deviceOrientationEvent.beta', 'mockBeta');
23 shouldBe('deviceOrientationEvent.gamma', 'mockGamma'); 23 shouldBe('deviceOrientationEvent.gamma', 'mockGamma');
24 shouldBe('deviceOrientationEvent.absolute', 'mockAbsolute'); 24 shouldBe('deviceOrientationEvent.absolute', 'mockAbsolute');
(...skipping 15 matching lines...) Expand all
40 testFailed('Too many events fired for first or second listener'); 40 testFailed('Too many events fired for first or second listener');
41 finishJSTest(); 41 finishJSTest();
42 } 42 }
43 43
44 window.addEventListener('deviceorientation', firstListener); 44 window.addEventListener('deviceorientation', firstListener);
45 45
46 window.jsTestIsAsync = true; 46 window.jsTestIsAsync = true;
47 </script> 47 </script>
48 </body> 48 </body>
49 </html> 49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698