Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…10962)

 - `if (testRunner)` should be `if (window.testRunner)`
 - Use String to pass sensor object param to avoid undefined error
  • Loading branch information
Honry authored and foolip committed Jun 14, 2018
1 parent 55c9a77 commit 7cbefa7
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_disabled(AmbientLightSensor);
run_fp_tests_disabled('AmbientLightSensor');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_enabled_by_attribute_redirect_on_load(AmbientLightSensor);
run_fp_tests_enabled_by_attribute_redirect_on_load('AmbientLightSensor');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_enabled_by_attribute(AmbientLightSensor);
run_fp_tests_enabled_by_attribute('AmbientLightSensor');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_enabled(AmbientLightSensor);
run_fp_tests_enabled('AmbientLightSensor');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_enabled_on_self_origin(AmbientLightSensor);
run_fp_tests_enabled_on_self_origin('AmbientLightSensor');
</script>
</body>
2 changes: 1 addition & 1 deletion ambient-light/AmbientLightSensor.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<div id="log"></div>
<script>

runGenericSensorTests(AmbientLightSensor);
runGenericSensorTests('AmbientLightSensor');

</script>
2 changes: 1 addition & 1 deletion ambient-light/AmbientLightSensor_onerror-manual.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ <h2>Precondition</h2>
</ol>
<script>

runGenericSensorOnerror(AmbientLightSensor);
runGenericSensorOnerror('AmbientLightSensor');

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script>
"use strict";

run_fp_tests_disabled(GeolocationSensor);
run_fp_tests_disabled('GeolocationSensor');

promise_test(async t => {
await promise_rejects(t, 'SecurityError', GeolocationSensor.read());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_enabled_by_attribute_redirect_on_load(GeolocationSensor);
run_fp_tests_enabled_by_attribute_redirect_on_load('GeolocationSensor');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_enabled_by_attribute(GeolocationSensor);
run_fp_tests_enabled_by_attribute('GeolocationSensor');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_enabled(GeolocationSensor);
run_fp_tests_enabled('GeolocationSensor');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script>
"use strict";

run_fp_tests_enabled_on_self_origin(GeolocationSensor);
run_fp_tests_enabled_on_self_origin('GeolocationSensor');
</script>
</body>
2 changes: 1 addition & 1 deletion geolocation-sensor/GeolocationSensor.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<script src="/generic-sensor/generic-sensor-tests.js"></script>
<script>

runGenericSensorTests(GeolocationSensor);
runGenericSensorTests('GeolocationSensor');

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ <h2>Precondition</h2>
</ol>
<script>

runGenericSensorOnerror(GeolocationSensor);
runGenericSensorOnerror('GeolocationSensor');

</script>
2 changes: 1 addition & 1 deletion proximity/ProximitySensor.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<div id="log"></div>
<script>

runGenericSensorTests(ProximitySensor);
runGenericSensorTests('ProximitySensor');

</script>
2 changes: 1 addition & 1 deletion proximity/ProximitySensor_onerror-manual.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ <h2>Precondition</h2>
</ol>
<script>

runGenericSensorOnerror(ProximitySensor);
runGenericSensorOnerror('ProximitySensor');

</script>
6 changes: 3 additions & 3 deletions resources/chromium/generic_sensor_mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ var GenericSensorTest = (() => {
if (testInternal.initialized)
throw new Error('Call reset() before initialize().');

if (testRunner) { // Grant sensor permissions for Chromium testrunner.
if (window.testRunner) { // Grant sensor permissions for Chromium testrunner.
['accelerometer', 'gyroscope',
'magnetometer', 'ambient-light-sensor'].forEach((entry) => {
testRunner.setPermission(entry, 'granted',
location.origin, location.origin);
window.testRunner.setPermission(entry, 'granted',
location.origin, location.origin);
});
}

Expand Down

0 comments on commit 7cbefa7

Please sign in to comment.