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
--- 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: {