Bug 400392 - "necko unit test test_reopen.js fails randomly on qm-centos5-01" [p=sylvain.pasche@gmail.com (Sylvain Pasche) r=biesi]
authorreed@reedloden.com
Thu, 08 Nov 2007 00:23:51 -0800
changeset 7686 9939042c81f6728c3c090e06ed263eac010fbbf8
parent 7685 5a605e029a390d080ad21f5145a41a467ff0118a
child 7687 765b5303915299ae97b5ac6ce2e6868f91d7332a
push idunknown
push userunknown
push dateunknown
reviewersbiesi
bugs400392
milestone1.9b2pre
Bug 400392 - "necko unit test test_reopen.js fails randomly on qm-centos5-01" [p=sylvain.pasche@gmail.com (Sylvain Pasche) r=biesi]
netwerk/test/unit/test_reopen.js
--- a/netwerk/test/unit/test_reopen.js
+++ b/netwerk/test/unit/test_reopen.js
@@ -35,17 +35,21 @@ function new_file_channel(file) {
 }
 
 
 function check_throws(closure, error) {
   var thrown = false;
   try {
     closure();
   } catch (e) {
-    do_check_eq(e.result, error);
+    if (error instanceof Array) {
+      do_check_neq(error.indexOf(e.result), -1);
+    } else {
+      do_check_eq(e.result, error);
+    }
     thrown = true;
   }
   do_check_true(thrown);
 }
 
 function check_open_throws(error) {
   check_throws(function() {
     chan.open(listener, null);
@@ -87,17 +91,17 @@ function run_next_test() {
   test_array[test_index++]();
 }
 
 function test_channel(createChanClosure) {
   // First, synchronous reopening test
   chan = createChanClosure();
   var inputStream = chan.open();
   check_open_throws(NS_ERROR_IN_PROGRESS);
-  check_async_open_throws(NS_ERROR_ALREADY_OPENED);
+  check_async_open_throws([NS_ERROR_IN_PROGRESS, NS_ERROR_ALREADY_OPENED]);
   
   // Then, asynchronous one
   chan = createChanClosure();
   chan.asyncOpen(listener, null);
   check_open_throws(NS_ERROR_IN_PROGRESS);
   check_async_open_throws(NS_ERROR_IN_PROGRESS);
 }