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

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

Issue 490773003: [DeviceLight] Add Layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
(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 from a callback works as expected.');
timvolodine 2014/09/29 16:43:53 what does "from a callback" mean? i don't see any
riju_ 2015/03/27 12:25:36 Done.
7
8 var mockLight = 10;
9
10 if (window.testRunner) {
11 testRunner.setMockDeviceLight(mockLight);
12 debug('TEST MODE enabled');
13 } else
14 debug('This test can not be run without the TestRunner');
15
16 var deviceLightEvent;
17 function checkLight(event) {
18 deviceLightEvent = event;
19 shouldBe('deviceLightEvent.value', 'mockLight');
20 }
21
22 function listener(event) {
23 checkLight(event);
24 finishJSTest();
25 }
26
27 window.addEventListener('devicelight', listener);
28 window.jsTestIsAsync = true;
29 </script>
30 </body>
31 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698