Bug 995688 - Always show scrollbars in test to avoid fade effect evicting document from BF cache. r=smaug, a=test-only
authorBen Kelly <ben@wanderview.com>
Wed, 06 Aug 2014 17:26:19 -0400
changeset 208253 8f34703f5065
parent 208252 e6cee3b7907e
child 208254 fc7ce6481ea9
push id3790
push userryanvm@gmail.com
push date2014-08-07 15:21 +0000
treeherdermozilla-beta@ee74d30a8968 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, test-only
bugs995688
milestone32.0
Bug 995688 - Always show scrollbars in test to avoid fade effect evicting document from BF cache. r=smaug, a=test-only
dom/workers/test/test_multi_sharedWorker_lifetimes.html
--- a/dom/workers/test/test_multi_sharedWorker_lifetimes.html
+++ b/dom/workers/test/test_multi_sharedWorker_lifetimes.html
@@ -7,31 +7,38 @@
   <head>
     <title>Test for SharedWorker</title>
     <script src="/tests/SimpleTest/SimpleTest.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
       <script class="testbody" type="text/javascript;version=1.7">
         "use strict";
 
         const swPref = "dom.workers.sharedWorkers.enabled";
+        const scrollbarPref = "layout.testing.overlay-scrollbars.always-visible";
         const bfCacheEnabledPref = "browser.sessionhistory.cache_subframes";
         const bfCacheDepthPref = "browser.sessionhistory.max_total_viewers";
         const bfCacheDepth = 10;
 
         const frameRelativeURL = "multi_sharedWorker_frame.html";
         const storedData = "0123456789abcdefghijklmnopqrstuvwxyz";
 
         let testGenerator = (function() {
           SimpleTest.waitForExplicitFinish();
 
           if (!SpecialPowers.getBoolPref(swPref)) {
             ok(!("SharedWorker" in window), "No SharedWorker without pref set");
           }
 
-          SpecialPowers.pushPrefEnv({ set: [[swPref, true]] }, sendToGenerator);
+          // Enable SharedWorkers and force scrollbar to always be shown.  The
+          // scrollbar setting is necessary to avoid the fade-in/fade-out from
+          // evicting our document from the BF cache below.  If bug 1049277
+          // is fixed, then we can stop setting the scrollbar pref here.
+          SpecialPowers.pushPrefEnv({ set: [[swPref, true],
+                                            [scrollbarPref, true]] },
+                                    sendToGenerator);
           yield undefined;
 
           window.addEventListener("message", function(event) {
             if (typeof(event.data) == "string") {
               info(event.data);
             } else {
               sendToGenerator(event);
             }