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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/DeviceLight/add-listener-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/DeviceLight/add-listener.html
diff --git a/LayoutTests/fast/dom/DeviceLight/add-listener.html b/LayoutTests/fast/dom/DeviceLight/add-listener.html
new file mode 100644
index 0000000000000000000000000000000000000000..15a26c177138713e0a6d3a8ce29402bf6d9d491f
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceLight/add-listener.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../../resources/js-test.js"></script>
+<script>
+description('Tests that adding a new devicelight event listener invokes a callback.');
+
+var mockLight = 10;
+
+if (window.testRunner)
+ testRunner.setMockDeviceLight(mockLight);
+else
+ debug('This test can not be run without the TestRunner');
+
+var deviceLightEvent;
+function checkLight(event) {
+ deviceLightEvent = event;
+ shouldBe('deviceLightEvent.value', 'mockLight');
+}
+
+function listener(event) {
+ checkLight(event);
+ finishJSTest();
+}
+
+window.addEventListener('devicelight', listener);
+window.jsTestIsAsync = true;
+</script>
+</body>
+</html>
« 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