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

Unified Diff: third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html

Issue 2381913002: [sensors] Dispatch sensor events using postTask (Closed)
Patch Set: Rebased. Created 4 years, 2 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 | third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
diff --git a/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
index 00fbba52ce1d0a5a1ab2f2ab1682575d545bfe4c..453a5ad136b5ebe85650d966565dbb902e984bf5 100644
--- a/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
+++ b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
@@ -23,6 +23,19 @@ test(() => assert_throws(
'Test that negative frequency causes exception from constructor.');
sensor_test(sensor => {
+ sensor.mockSensorProvider.setGetSensorShouldFail(true);
+ let ambientLightSensor = new AmbientLightSensor();
+ ambientLightSensor.start();
+ return new Promise((resolve, reject) => {
+ ambientLightSensor.onstatechange = event => {
+ if(ambientLightSensor.state == 'errored') {
+ resolve();
+ }
+ };
+ });
+}, 'Test that sensor state changes to "errored" when sensor is not supported.');
+
+sensor_test(sensor => {
let ambientLightSensor = new AmbientLightSensor({frequency: 560});
ambientLightSensor.start();
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698