Bug 1217909 P7 Fix mochitest to expect TypeError when serviceWorker.register() rejects. r=catalinb a=ritu
authorBen Kelly <ben@wanderview.com>
Wed, 18 Nov 2015 13:07:42 -0800
changeset 305549 a52aade1c18db27e557ac83388fa366a5f37bc86
parent 305548 12b35260675203ea28fd671cdb039a67dd9ab8c0
child 305550 c95dd88249192a96a16d0fb97ad135e3c4d8b987
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatalinb, ritu
bugs1217909
milestone44.0a2
Bug 1217909 P7 Fix mochitest to expect TypeError when serviceWorker.register() rejects. r=catalinb a=ritu
dom/workers/test/serviceworkers/test_notification_constructor_error.html
--- a/dom/workers/test/serviceworkers/test_notification_constructor_error.html
+++ b/dom/workers/test/serviceworkers/test_notification_constructor_error.html
@@ -16,17 +16,17 @@
 <div id="content" style="display: none"></div>
 <pre id="test"></pre>
 <script class="testbody" type="text/javascript">
 
   function simpleRegister() {
     return navigator.serviceWorker.register("notification_constructor_error.js", { scope: "notification_constructor_error/" }).then(function(swr) {
       ok(false, "Registration should fail.");
     }, function(e) {
-      ok(e.message.indexOf("Notification") != -1, "Registration should fail.");
+      is(e.name, 'TypeError', "Registration should fail with a TypeError.");
     });
   }
 
   function runTest() {
     MockServices.register();
     simpleRegister()
       .then(function() {
         MockServices.unregister();