Bug 475441. Make the media cache size really small while we're running mochitests, to give the cache code a thorough workout. r=doublec
☠☠ backed out by 004e605b74c3 ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 01 Apr 2009 13:52:56 +1300
changeset 26797 c166dc4af1677b6ee98f36c8f80853d2aba1a841
parent 26796 b6a1093e58149cb3efb670f6a5758a50d813816c
child 26798 3d97aaee86153b1e1245b7a126a04c5ee6a4355d
child 26810 004e605b74c39c7cfa77cab5d2c0ff422cd5c44d
push id6240
push userrocallahan@mozilla.com
push dateWed, 01 Apr 2009 01:35:34 +0000
treeherderautoland@7157cc2440bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdoublec
bugs475441
milestone1.9.2a1pre
Bug 475441. Make the media cache size really small while we're running mochitests, to give the cache code a thorough workout. r=doublec
build/automation.py.in
content/media/video/test/Makefile.in
content/media/video/test/test_progress1.html
content/media/video/test/test_progress2.html
content/media/video/test/test_progress3.html
content/media/video/test/test_progress4.html
content/media/video/test/use_large_cache.js
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -240,16 +240,17 @@ user_pref("javascript.options.showInCons
 user_pref("layout.debug.enable_data_xbl", true);
 user_pref("browser.EULA.override", true);
 user_pref("javascript.options.jit.content", true);
 user_pref("gfx.color_management.force_srgb", true);
 user_pref("network.manage-offline-status", false);
 user_pref("security.default_personal_cert", "Select Automatically"); // Need to client auth test be w/o any dialogs
 user_pref("network.http.prompt-temp-redirect", false);
 user_pref("svg.smil.enabled", true); // Needed for SMIL mochitests until bug 482402 lands
+user_pref("media.cache_size", 100);
 
 user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others
 """
   
   prefs.append(part)
 
   # Increase the max script run time 10-fold for debug builds
   if (IS_DEBUG_BUILD):
--- a/content/media/video/test/Makefile.in
+++ b/content/media/video/test/Makefile.in
@@ -51,16 +51,17 @@ include $(topsrcdir)/config/rules.mk
 		test_constants.html \
 		test_controls.html \
 		test_currentTime.html \
 		test_networkState.html \
 		test_paused.html \
 		test_readyState.html \
 		test_seek2.html \
 		test_volume.html \
+		use_large_cache.js \
 		$(NULL)
 
 ifdef MOZ_OGG
 _TEST_FILES += \
 		test_access_control.html \
 		file_access_controls.html \
 		test_bug448534.html \
 		test_bug461281.html \
--- a/content/media/video/test/test_progress1.html
+++ b/content/media/video/test/test_progress1.html
@@ -3,16 +3,17 @@
 <head>
   <title>Media test: progress events</title>
   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <pre id="test">
+<script src="use_large_cache.js"></script>
 <script class="testbody" type="text/javascript">
 var completed = false;
 var load_count = 0;
 var last_progress = false;
 var last_progress_total = 0;
 
 function on_loadedmetadata() {
   var v = document.getElementById('v');
--- a/content/media/video/test/test_progress2.html
+++ b/content/media/video/test/test_progress2.html
@@ -3,16 +3,17 @@
 <head>
   <title>Media test: progress events</title>
   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <pre id="test">
+<script src="use_large_cache.js"></script>
 <script class="testbody" type="text/javascript">
 // Test progress events with wav backend
 var completed = false;
 var last_progress = false;
 var last_progress_total = 0;
 
 function on_loadedmetadata() {
   var v = document.getElementById('v');
--- a/content/media/video/test/test_progress3.html
+++ b/content/media/video/test/test_progress3.html
@@ -3,16 +3,17 @@
 <head>
   <title>Media test: progress events</title>
   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <pre id="test">
+<script src="use_large_cache.js"></script>
 <script class="testbody" type="text/javascript">
 // Same as test_progress1 but uses a smaller file to test resource loaded
 // before metadata loaded is fired.
 var completed = false;
 var load_count = 0;
 var last_progress = false;
 var last_progress_total = 0;
 
--- a/content/media/video/test/test_progress4.html
+++ b/content/media/video/test/test_progress4.html
@@ -3,16 +3,17 @@
 <head>
   <title>Media test: progress events</title>
   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <pre id="test">
+<script src="use_large_cache.js"></script>
 <script class="testbody" type="text/javascript">
 // Test progress events with wav backend
 // Same as test_progress2 but uses a smaller file to test resource loaded
 // before metadata loaded is fired.
 var completed = false;
 var last_progress = false;
 var last_progress_total = 0;
 
new file mode 100644
--- /dev/null
+++ b/content/media/video/test/use_large_cache.js
@@ -0,0 +1,14 @@
+(function() {
+  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+  // Set cache size to something large
+  var prefService = Components.classes["@mozilla.org/preferences-service;1"]
+                               .getService(Components.interfaces.nsIPrefService);
+  var branch = prefService.getBranch("media.");
+  var oldSize = branch.getIntPref("cache_size");
+  branch.setIntPref("cache_size", 40000);
+
+  window.addEventListener("unload", function() {
+    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+    branch.setIntPref("cache_size", oldSize);
+  }, false);
+ })();