Skip to content

Commit 5136eac

Browse files
Mikhail Pozdnyakovchromium-wpt-export-bot
Mikhail Pozdnyakov
authored andcommitted
Add [SecureContext] IDL attribute to sensor interfaces
As it follows from w3c/sensors#313 Change-Id: Ic81e118b2a3c8db6d8b30ee61ef8811b88a0f970 Reviewed-on: https://chromium-review.googlesource.com/721742 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Commit-Queue: Mikhail Pozdnyakov <[email protected]> Cr-Commit-Position: refs/heads/master@{#509707}
1 parent b952881 commit 5136eac

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

accelerometer/Accelerometer_insecure_context.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ <h2>Precondition</h2>
1515
</ol>
1616
<script>
1717

18-
runGenericSensorInsecureContext(Accelerometer);
18+
runGenericSensorInsecureContext("Accelerometer");
1919

2020
</script>

generic-sensor/generic-sensor-tests.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ function runGenericSensorTests(sensorType) {
194194

195195
function runGenericSensorInsecureContext(sensorType) {
196196
test(() => {
197-
assert_throws('SecurityError', () => { new sensorType(); });
198-
}, `${sensorType.name}: throw a 'SecurityError' when construct sensor in an insecure context`);
197+
assert_false(sensorType in window, `${sensorType} must not be exposed`);
198+
}, `${sensorType} is not exposed in an insecure context`);
199199
}
200200

201201
function runGenericSensorOnerror(sensorType) {

gyroscope/Gyroscope_insecure_context.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ <h2>Precondition</h2>
1515
</ol>
1616
<script>
1717

18-
runGenericSensorInsecureContext(Gyroscope);
18+
runGenericSensorInsecureContext("Gyroscope");
1919

2020
</script>

magnetometer/Magnetometer_insecure_context.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ <h2>Precondition</h2>
1515
</ol>
1616
<script>
1717

18-
runGenericSensorInsecureContext(Magnetometer);
18+
runGenericSensorInsecureContext("Magnetometer");
1919

2020
</script>

orientation-sensor/OrientationSensor_insecure_context.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h2>Note:</h2>
1515
</ol>
1616
<script>
1717

18-
runGenericSensorInsecureContext(AbsoluteOrientationSensor);
19-
runGenericSensorInsecureContext(RelativeOrientationSensor);
18+
runGenericSensorInsecureContext("AbsoluteOrientationSensor");
19+
runGenericSensorInsecureContext("RelativeOrientationSensor");
2020

2121
</script>

0 commit comments

Comments
 (0)