Index: LayoutTests/http/tests/security/powerfulFeatureRestrictions/getUserMedia-on-insecure-origin.html |
diff --git a/LayoutTests/http/tests/security/powerfulFeatureRestrictions/getUserMedia-on-insecure-origin.html b/LayoutTests/http/tests/security/powerfulFeatureRestrictions/getUserMedia-on-insecure-origin.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1d106bbfc018ec1f9789ef352edc71ff10219476 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/powerfulFeatureRestrictions/getUserMedia-on-insecure-origin.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE html> |
+<title>getUserMedia On An Insecure Origin</title> |
+<script src="/resources/testharness.js"></script> |
+<script src="/resources/testharnessreport.js"></script> |
+<script src="/resources/get-host-info.js"></script> |
+<script> |
+if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { |
+ window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.pathname; |
+} else { |
+ if (window.testRunner) |
+ testRunner.overridePreference("WebKitStrictPowerfulFeatureRestrictions", true); |
+ |
+ test(function () { |
+ assert_throws( |
+ "SecurityError", |
+ function() { |
+ navigator.webkitGetUserMedia( |
+ { video:true }, |
+ function() { assert_unreached("Success callback should not be called."); }, |
+ function() { assert_unreached("Error callback should not be called."); }); |
+ }); |
+ }, 'getUserMedia'); |
+} |
+</script> |