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..f91f917f5869d650f33ec74dee49c547661ff9ee |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin.html |
@@ -0,0 +1,96 @@ |
+<!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(); |
+ })); |
+ }); |
+} |
+</script> |
+</body> |
+</html> |