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

Unified Diff: LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin.html

Issue 1115913002: Add deprecation warnings to old powerful features on insecure origins. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updates from nits Created 5 years, 8 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
Index: LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin.html
diff --git a/LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin.html b/LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin.html
new file mode 100644
index 0000000000000000000000000000000000000000..fd0c3cc824eee30c4e4b789190a90d52be27a239
--- /dev/null
+++ b/LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Old Powerful Features on an Insecure Origin</title>
+</head>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/get-host-info.js"></script>
+
+<body>
+<div id="target"></div>
+<script>
+if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
+ window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.pathname;
+} else {
+ if (!window.internals)
+ assert_unreached('window.internals is required for this test');
+
+ var mockLatitude = 51.478;
+ var mockLongitude = -0.166;
+ var mockAccuracy = 100.0;
+
+ internals.setGeolocationClientMock(document);
+ internals.setGeolocationPermission(document, true);
+ internals.setGeolocationPosition(document,
+ mockLatitude,
+ mockLongitude,
+ mockAccuracy);
+
+ async_test(function() {
+ navigator.geolocation.getCurrentPosition(
+ this.step_func(function() {
+ this.done();
+ }),
+ this.step_func(function(error) {
+ assert_unreached('getCurrentPosition should succeed, but failed.');
+ this.done();
+ }));
+ }, 'getCurrentPosition');
+
+ // Note that the deprecation message for watchPosition() will be supressed
+ // because it is an exact duplicate of the getCurrentPosition() message.
+ // Thus, this test is really to confirm that it still executes.
+ async_test(function() {
+ navigator.geolocation.watchPosition(
+ this.step_func(function() {
+ this.done();
+ }),
+ this.step_func(function(error) {
+ assert_unreached('watchPosition should succeed, but failed.');
+ this.done();
+ }));
+ }, 'watchPosition');
+
+ async_test(function() {
+ var element = document.getElementById('target');
+ document.addEventListener('fullscreenerror', this.step_func(function(e) {
+ assert_unreached('requestFullscreen should succeed, but failed.');
+ this.done();
+ }));
+ document.addEventListener('fullscreenchange', this.step_func(function() {
+ this.done();
+ }));
+
+ var request = element.requestFullscreen.bind(element);
+ document.addEventListener("click", request);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ document.removeEventListener("click", request);
+ }, 'fullscreen');
+
+ async_test(function() {
+ navigator.webkitGetUserMedia({ audio: true, video: true },
+ this.step_func(function() {
+ this.done();
+ }),
+ this.step_func(function() {
+ assert_unreached('getUserMedia should succeed, but failed.');
+ this.done();
+ }));
+ }, 'getUserMedia');
+
+ async_test(function() {
+ testRunner.setMockDeviceMotion(true, 0, true, 0, true, 0,
+ true, 0, true, 0, true, 0,
+ true, 0, true, 0, true, 0,
+ 0);
+
+ window.addEventListener('devicemotion', this.step_func(function() {
+ this.done();
+ }));
+ }, 'device motion');
+
+ async_test(function() {
+ testRunner.setMockDeviceOrientation(11.1, 22.2, 33.3, true);
+
+ window.addEventListener('deviceorientation', this.step_func(function() {
+ this.done();
+ }));
+ }, 'device orientation');
+}
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698