Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / serviceworker / registration.html
index 512edfb..5d15d6f 100644 (file)
@@ -71,7 +71,7 @@
                 assert_unreached('Registration of non-existent script should fail.');
             }),
             t.step_func(function(reason) {
-                assert_equals(reason.name, 'AbortError',
+                assert_equals(reason.name, 'NetworkError',
                              'Registration of non-existent script should fail.');
                 t.done();
             })
     });
 }());
 
+(function() {
+    var t = async_test('Registering script without correct MIME type');
+    t.step(function() {
+        navigator.serviceWorker.register(
+            'resources/plain-text-worker.php'
+        ).then(
+            t.step_func(function(registration) {
+                assert_unreached('Registration of plain text script should fail.');
+            }),
+            t.step_func(function(reason) {
+                assert_equals(reason.name, 'SecurityError',
+                             'Registration of plain text script should fail.');
+                t.done();
+            })
+        );
+    });
+}());
+
+(function() {
+    var t = async_test('Registering redirected script');
+    t.step(function() {
+        navigator.serviceWorker.register(
+            'resources/redirect.php?Redirect=' +
+            encodeURIComponent('/resources/registration-worker.js')
+        ).then(
+            t.step_func(function(registration) {
+                assert_unreached('Registration of redirected script should fail.');
+            }),
+            t.step_func(function(reason) {
+                assert_equals(reason.name, 'SecurityError',
+                              'Registration of redirected script should fail.');
+                t.done();
+            })
+        );
+    });
+}());
+
 </script>