2 <title>Register a ServiceWorker On An Insecure Origin</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script>
7 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
8 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.pathname;
10 async_test(function() {
11 var scope = '/registration/';
12 navigator.serviceWorker.register(
13 'resources/registration-worker.js',
16 this.step_func(function() {
17 assert_unreached('Registration should fail, but succeeded.');
18 service_worker_unregister_and_done(this, scope);
20 this.step_func(function(reason) {
21 assert_equals(reason.name, "NotSupportedError");
25 }, "Registering on an unauthenticated origin");