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

Unified Diff: third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js

Issue 2675483003: [Sensors] Introduce 'unconnected' sensor state (Closed)
Patch Set: rebased Created 3 years, 10 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/Source/modules/sensor/Sensor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
diff --git a/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js b/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
index 3f671e44035b77752c5dd9dced9f7b97ca735364..b0baa2a077e1b87b5a3ba20556fa5974c54dfb7f 100644
--- a/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
+++ b/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
@@ -97,9 +97,11 @@ function runGenericSensorTests(sensorType, updateReading, verifyReading) {
}, 'Test that frequency is capped to the maximum supported from frequency.');
sensor_test(sensor => {
- let sensorObject = new sensorType({frequency: 60});
- sensorObject.start();
- let testPromise = sensor.mockSensorProvider.getCreatedSensor()
+ let sensorObject = new sensorType({frequency: 60});
+ assert_equals(sensorObject.state, 'unconnected');
+ sensorObject.start();
+ assert_equals(sensorObject.state, 'activating');
+ let testPromise = sensor.mockSensorProvider.getCreatedSensor()
.then((mockSensor) => {
return new Promise((resolve, reject) => {
let wrapper = new CallbackWrapper(() => {
@@ -113,8 +115,8 @@ function runGenericSensorTests(sensorType, updateReading, verifyReading) {
});
})
.then(mockSensor => { return mockSensor.removeConfigurationCalled(); });
- return testPromise;
- }, 'Test that sensor can be successfully created if sensor is supported.');
+ return testPromise;
+ }, 'Test that sensor can be successfully created and its states are correct.');
sensor_test(sensor => {
let sensorObject = new sensorType();
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/sensor/Sensor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698