Bug 677427: netwerk/test/unit/test_bug650955.js fails on Android; r=bjarne
authorGeoff Brown <gbrown@mozilla.com>
Tue, 06 Sep 2011 16:52:00 -0700
changeset 76626 bc6b53c4e9312eb9c6ebe2e7582e8e99d5871124
parent 76625 3ae9b2a742df99f77c0f978eeb35f308088bcceb
child 76627 0eb03db3606b3665cf5f3806bd43df01147c2f02
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbjarne
bugs677427, 650955
milestone9.0a1
Bug 677427: netwerk/test/unit/test_bug650955.js fails on Android; r=bjarne
netwerk/test/unit/test_bug650955.js
netwerk/test/unit/xpcshell.ini
--- a/netwerk/test/unit/test_bug650955.js
+++ b/netwerk/test/unit/test_bug650955.js
@@ -67,17 +67,39 @@ function nextTest() {
     }
     do_execute_soon(function() { aTest.start(); } );
 }
 
 // Just make sure devices are created
 function InitializeCacheDevices(memDevice, diskDevice) {
     this.start = function() {
         prefService.setBoolPref("browser.cache.memory.enable", memDevice);
+        if (memDevice) {
+            try {
+                cap = prefService.getIntPref("browser.cache.memory.capacity");
+            }
+            catch(ex) {
+                cap = 0;
+            }
+            if (cap == 0) {
+                prefService.setIntPref("browser.cache.memory.capacity", 1024);
+            }
+        }
         prefService.setBoolPref("browser.cache.disk.enable", diskDevice);
+        if (diskDevice) {
+            try {
+                cap = prefService.getIntPref("browser.cache.disk.capacity");
+            }
+            catch(ex) {
+                cap = 0;
+            }
+            if (cap == 0) {
+                prefService.setIntPref("browser.cache.disk.capacity", 1024);
+            }
+        }
         var channel = setupChannel("/bug650995", "Initial value");
         channel.asyncOpen(new ChannelListener(
             nextTest, null),
             null);
     }
 }
 
 function TestCacheEntrySize(setSizeFunc, firstRequest, secondRequest, secondExpectedReply) {
--- a/netwerk/test/unit/xpcshell.ini
+++ b/netwerk/test/unit/xpcshell.ini
@@ -62,18 +62,16 @@ skip-if = os == "android"
 [test_bug561276.js]
 [test_bug580508.js]
 [test_bug586908.js]
 [test_bug588389.js]
 [test_bug596443.js]
 [test_bug618835.js]
 [test_bug633743.js]
 [test_bug650955.js]
-# Bug 677427: test fails consistently on Android
-fail-if = os == "android"
 [test_bug652761.js]
 [test_bug651100.js]
 # Bug 675044: test fails consistently on Android
 fail-if = os == "android"  
 [test_bug654926.js]
 # Bug 675049: test fails consistently on Android
 fail-if = os == "android"  
 [test_bug654926_doom_and_read.js]