Bug 1272381 - Use chromeScript.sendSyncMessage to initialize array and avoid race in test a=testonly
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 12 Jul 2016 15:06:25 +0300
changeset 329732 2ad25a16424e510935ea3bca7822039c51c05340
parent 329731 b9eb5ec3696cb11155fb470477bf0cb49bfc0a9f
child 329733 2f727a828ea03e04c3e84e986af359b8091a4b35
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1272381
milestone50.0a1
Bug 1272381 - Use chromeScript.sendSyncMessage to initialize array and avoid race in test a=testonly MozReview-Commit-ID: DxdsE6zwHqK
netwerk/test/mochitests/test_user_agent_updates.html
--- a/netwerk/test/mochitests/test_user_agent_updates.html
+++ b/netwerk/test/mochitests/test_user_agent_updates.html
@@ -189,25 +189,28 @@ function testBadUpdate(callback) {
       callback();
     }, false);
     document.getElementById('content').appendChild(ifr);
   }, 5000); });
 }
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("Test sets timeouts to wait for updates to happen.");
-SimpleTest.requestCompleteLog();
 
 SpecialPowers.pushPrefEnv({
   set: [
     [PREF_APP_UPDATE_TIMERMINIMUMDELAY, 0]
   ]
 }, function () {
   chromeScript.sendSyncMessage("UAO-uninit");
 
+  // Sets the OVERRIDES var in the chrome script.
+  // We do this to avoid code duplication.
+  chromeScript.sendSyncMessage("set-overrides", OVERRIDES);
+
   // testProfileLoad, testDownload, and testProfileSave must run in this order
   //  because testDownload depends on testProfileLoad to call UAO.init()
   //  and testProfileSave depends on testDownload to save overrides to the profile
   chromeScript.sendAsyncMessage("testProfileLoad", location.hostname);
 });
 
 
 const chromeScript = SpecialPowers.loadChromeScript(_ => {
@@ -354,14 +357,13 @@ chromeScript.addMessageListener("testPro
 
 chromeScript.addMessageListener("is-message", function(params) {
   let {value, expected, message} = params;
   is(value, expected, message);
 });
 chromeScript.addMessageListener("info-message", function(message) {
   info(message);
 });
-chromeScript.sendAsyncMessage("set-overrides", OVERRIDES);
 
 </script>
 </pre>
 </body>
 </html>