Bug 1356457 - Fix and enable test_ext_proxy.html r?jmaher draft
authorMatthew Wein <mwein@mozilla.com>
Mon, 01 May 2017 11:25:04 -0400
changeset 570887 ca36edb61e1d7e57e772b2093941d1bb0f57f7a2
parent 570886 57b37213d81150642f5139764e7044b07b9dccc3
child 626602 8e2dd9b24cb56db7ed17dfe5e63ea734169b7dd0
push id56612
push usermwein@mozilla.com
push dateMon, 01 May 2017 15:58:24 +0000
reviewersjmaher
bugs1356457
milestone55.0a1
Bug 1356457 - Fix and enable test_ext_proxy.html r?jmaher I was able to fix the issue by only letting the background script send one error message per test. This isn't an ideal fix because it doesn't get to the bottom of why a second error message is sometimes sent, but it should be a good placeholder while the underlying issue is researched. MozReview-Commit-ID: 21uZL3r4zVS
toolkit/components/extensions/test/mochitest/mochitest-common.ini
toolkit/components/extensions/test/mochitest/test_ext_proxy.html
--- a/toolkit/components/extensions/test/mochitest/mochitest-common.ini
+++ b/toolkit/components/extensions/test/mochitest/mochitest-common.ini
@@ -71,17 +71,16 @@ skip-if = os == 'android' # Android does
 [test_ext_exclude_include_globs.html]
 [test_ext_external_messaging.html]
 [test_ext_generate.html]
 [test_ext_geolocation.html]
 skip-if = os == 'android' # Android support Bug 1336194
 [test_ext_notifications.html]
 [test_ext_permission_xhr.html]
 [test_ext_proxy.html]
-skip-if = true # bug 1356457
 [test_ext_runtime_connect.html]
 [test_ext_runtime_connect_twoway.html]
 [test_ext_runtime_connect2.html]
 [test_ext_runtime_disconnect.html]
 [test_ext_runtime_id.html]
 [test_ext_sandbox_var.html]
 [test_ext_sendmessage_reply.html]
 [test_ext_sendmessage_reply2.html]
--- a/toolkit/components/extensions/test/mochitest/test_ext_proxy.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_proxy.html
@@ -13,18 +13,22 @@
 <script type="text/javascript">
 /* eslint no-unused-vars: ["error", {"args": "none", "varsIgnorePattern": "^(FindProxyForURL)$"}] */
 
 "use strict";
 
 function* testProxyScript(script, expected) {
   let extension = ExtensionTestUtils.loadExtension({
     background() {
+      let errorReceived = false;
       browser.proxy.onProxyError.addListener(error => {
-        browser.test.sendMessage("proxy-error-received", error);
+        if (!errorReceived) {
+          errorReceived = true;
+          browser.test.sendMessage("proxy-error-received", error);
+        }
       });
 
       browser.proxy.registerProxyScript("proxy_script.js");
     },
     manifest: {
       "permissions": ["proxy"],
     },
     files: {