Bug 784388 - Remove setTimeout from device storage watch tests. r=khuey
authorDoug Turner <dougt@dougt.org>
Sun, 26 Aug 2012 21:33:44 -0700
changeset 103527 32d1839f85a8887fb5cfe20dbf4825f395aac5cf
parent 103526 16c5acf424367682bec5be4378720567a0d72c09
child 103528 59f82234c8d9c584e2b2f97b81903ba2c312cd73
push id14018
push userdougt@mozilla.com
push dateMon, 27 Aug 2012 04:34:27 +0000
treeherdermozilla-inbound@59f82234c8d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs784388
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 784388 - Remove setTimeout from device storage watch tests. r=khuey
dom/devicestorage/test/test_watch.html
dom/devicestorage/test/test_watchOther.html
--- a/dom/devicestorage/test/test_watch.html
+++ b/dom/devicestorage/test/test_watch.html
@@ -44,26 +44,22 @@ function onChange(e) {
     devicestorage_cleanup();
   }
   else {
     // we may see other file changes during the test, and
     // that is completely ok
   }
 }
 
-function makeFile() {
-  request = storage.addNamed(createRandomBlob(), gFileName);
-  ok(request, "Should have a non-null request");
-
-  request.onsuccess = addSuccess;
-  request.onerror = addError;
-}
-
 var storage = navigator.getDeviceStorage("testing");
 ok(storage, "Should have storage");
 storage.addEventListener("change", onChange);
 
-setTimeout(makeFile,100);
+request = storage.addNamed(createRandomBlob(), gFileName);
+ok(request, "Should have a non-null request");
+
+request.onsuccess = addSuccess;
+request.onerror = addError;
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/devicestorage/test/test_watchOther.html
+++ b/dom/devicestorage/test/test_watchOther.html
@@ -49,30 +49,26 @@ function onChange(e) {
   }
 }
 
 function onChangeFail(e) {
   dump("onChangeFail: " + e.path + " " + e.reason + "\n");
   ok(false, "We should never see any changes");
 }
 
-function makeFile() {
-  request = storage.addNamed(createRandomBlob(), gFileName);
-  ok(request, "Should have a non-null request");
-
-  request.onsuccess = addSuccess;
-  request.onerror = addError;
-}
-
 var storage = navigator.getDeviceStorage("testing");
 ok(storage, "Should have storage");
 storage.addEventListener("change", onChange);
 
 var storageOther = navigator.getDeviceStorage("testing-other");
 ok(storageOther, "Should have storage");
 storageOther.addEventListener("change", onChangeFail);
 
-setTimeout(makeFile,100);
+request = storage.addNamed(createRandomBlob(), gFileName);
+ok(request, "Should have a non-null request");
+
+request.onsuccess = addSuccess;
+request.onerror = addError;
 
 </script>
 </pre>
 </body>
 </html>