Bug 1600201 - Register mock external protocol handler before running test-phishing-bar.js; r=aleca
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 29 Nov 2019 13:55:26 +1300
changeset 36751 a5a20755812560254bda1c712ef36d27c491d529
parent 36750 2277b9c74c7d3f8852521f4c8d48e032b5431893
child 36752 2328b40f1537207039d6f81c1847c40b653253d4
push id2534
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:52:51 +0000
treeherdercomm-beta@055c50840778 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleca
bugs1600201
Bug 1600201 - Register mock external protocol handler before running test-phishing-bar.js; r=aleca
mail/test/mozmill/message-header/test-phishing-bar.js
--- a/mail/test/mozmill/message-header/test-phishing-bar.js
+++ b/mail/test/mozmill/message-header/test-phishing-bar.js
@@ -5,16 +5,19 @@
 /**
  * Test that phishing notifications behave properly.
  */
 
 "use strict";
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var { gMockExtProtSvcReg } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
 var {
   add_message_to_folder,
   be_in_folder,
   create_folder,
   create_message,
   mc,
   open_message_from_file,
   select_click_row,
@@ -38,16 +41,18 @@ var {
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var folder;
 
 var kBoxId = "mail-notification-top";
 var kNotificationValue = "maybeScam";
 
 function setupModule(module) {
+  gMockExtProtSvcReg.register();
+
   folder = create_folder("PhishingBarA");
   add_message_to_folder(
     folder,
     create_message({
       body: {
         body: '<form action="http://localhost/download-me"><input></form>.',
         contentType: "text/html",
       },
@@ -97,16 +102,20 @@ function setupModule(module) {
       body: {
         body: '<form action="http://localhost/download-me"><input></form>.',
         contentType: "text/html",
       },
     })
   );
 }
 
+function teardownModule() {
+  gMockExtProtSvcReg.unregister();
+}
+
 /**
  * Make sure the notification shows, and goes away once the Ignore menuitem
  * is clicked.
  */
 function assert_ignore_works(aController) {
   wait_for_notification_to_show(aController, kBoxId, kNotificationValue);
   let prefButton = get_notification_button(
     aController,