Merge mozilla-central to autoland. a=merge CLOSED TREE
authorshindli <shindli@mozilla.com>
Mon, 16 Jul 2018 12:29:59 +0300
changeset 818980 587ae47d1f16f88402bd415318323d6a77efb9fb
parent 818979 01f390f36d953e54ae4c17126ac7d9764a6e3470 (current diff)
parent 818682 2ed1506d1dc7db3d70a3feed95f1456bce05bbee (diff)
child 818981 33052f9ca1ce0415ce80a22d26ee686c1d90984d
push id116413
push userbgrinstead@mozilla.com
push dateMon, 16 Jul 2018 22:40:17 +0000
reviewersmerge
milestone63.0a1
Merge mozilla-central to autoland. a=merge CLOSED TREE
--- a/build/win32/mozconfig.vs-latest
+++ b/build/win32/mozconfig.vs-latest
@@ -1,2 +1,3 @@
 . $topsrcdir/build/win32/mozconfig.vs2017
 . "$topsrcdir/build/mozconfig.clang-cl"
+. "$topsrcdir/build/mozconfig.lld-link"
--- a/build/win64/mozconfig.vs-latest
+++ b/build/win64/mozconfig.vs-latest
@@ -1,2 +1,3 @@
 . $topsrcdir/build/win64/mozconfig.vs2017
 . "$topsrcdir/build/mozconfig.clang-cl"
+. "$topsrcdir/build/mozconfig.lld-link"
--- a/layout/base/tests/test_bug607529.html
+++ b/layout/base/tests/test_bug607529.html
@@ -18,48 +18,66 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
   /* General idea: Open a new window (needed because we don't bfcache
      subframes) that uses requestAnimationFrame, navigate it, navigate it
      back, and verify that the animations are still running.  */
 
   var doneOneLoad = false;
+  var done = false;
 
   /** Test for Bug 607529 **/
-  var done = false;
+
+  function closeWindowAndFinish() {
+    w.close();
+    window.onmessage = null;
+    SimpleTest.finish();
+  }
+
   window.onmessage = function(e) {
     isnot(e.data, "notcached", "Should never end up not being cached");
   
-    if (e.data == "loaded" && !doneOneLoad) {
-      doneOneLoad = true;
-      w.location = "file_bug607529-1.html";
+    if (e.data == "loaded") {
+      if (!doneOneLoad) {
+        doneOneLoad = true;
+        w.location = "file_bug607529-1.html";
+      } else {
+        // This is unexpected, but it can happen on Android, probably when
+        // bfcache gets purged due to memory pressure. Hence, "soft fail" there.
+        var message = "onload handler shouldn't fire on restore from bfcache";
+        if (navigator.appVersion.includes("Android")) {
+          todo(false, message);
+        } else {
+          ok(false, message);
+        }
+        // In any case, more messages aren't coming, so finish up.
+        closeWindowAndFinish();
+      }
     }
     else if (e.data == "goback") {
       w.history.back();
     }
     else if (e.data == "revived") {
       w.postMessage("report", "*");
     }
     else if (e.data == "callbackHappened") {
       // We might get this message more than once, if the other page queues up
       // more than one callbackHappened message before we manage to close it.
       // Protect against calling SimpleTest.finish() more than once.
       if (!done) {
-        w.close();
-        window.onmessage = null;
-        SimpleTest.finish();
+        closeWindowAndFinish();
         done = true;
       }
     } else {
       try {
         var msg = JSON.parse(e.data);
       } catch (ex) {
-        // Diagnostic for Bug 1462983: if JSON.parse throws, pause to print
-        // the string that it choked on, and then resume throwing the exception.
+        // In case JSON.parse throws, we pause to print the string that it
+        // choked on, and then resume throwing the exception.
         ok(false, "JSON.parse threw, when passed string '" + e.data + "'");
         throw ex;
       }
       if (msg.error) {
         window.onerror(msg.msg, msg.url, msg.line);
       }
     }
   };