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

Side by Side Diff: LayoutTests/fast/dom/DeviceLight/add-listener.html

Issue 490773003: [DeviceLight] Add Layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tim's comments Created 5 years, 8 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/DeviceLight/add-listener-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 description('Tests that adding a new devicelight event listener invokes a callba ck.');
7
8 var mockLight = 10;
9
10 if (window.testRunner)
11 testRunner.setMockDeviceLight(mockLight);
12 else
13 debug('This test can not be run without the TestRunner');
14
15 var deviceLightEvent;
16 function checkLight(event) {
17 deviceLightEvent = event;
18 shouldBe('deviceLightEvent.value', 'mockLight');
19 }
20
21 function listener(event) {
22 checkLight(event);
23 finishJSTest();
24 }
25
26 window.addEventListener('devicelight', listener);
27 window.jsTestIsAsync = true;
28 </script>
29 </body>
30 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/DeviceLight/add-listener-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698