Backed out changeset 89ddc7709fa8 (bug 980136)
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 11 Mar 2014 12:17:02 -0400
changeset 190249 ce7915f22b2d08cbb5da1225a27054259f3ff560
parent 190248 6b9e23e1aa85a1b7a7e4f2d90b6244400ada8e1a
child 190250 428e5462fe29ecbd861d170584968874d39be1c9
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs980136
milestone30.0a1
backs out89ddc7709fa800bc69d1092ac08484271fff37e7
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
Backed out changeset 89ddc7709fa8 (bug 980136)
dom/devicestorage/test/test_fs_get.html
--- a/dom/devicestorage/test/test_fs_get.html
+++ b/dom/devicestorage/test/test_fs_get.html
@@ -17,17 +17,16 @@ https://bugzilla.mozilla.org/show_bug.cg
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=910412">Mozilla Bug 910412</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 devicestorage_setup();
-SimpleTest.requestCompleteLog();
 
 // The root directory object.
 var gRoot = null;
 var gSub1 = null;
 var gSub2 = null;
 var gTestCount = 0;
 var gPath = "/";
 
@@ -154,51 +153,31 @@ function cbError(e) {
 
 function cbSuccess(e) {
   ok(false, "Should not arrive at cbSuccess!");
   devicestorage_cleanup();
 }
 
 ok(navigator.getDeviceStorage, "Should have getDeviceStorage.");
 
-var gStorage = navigator.getDeviceStorage("pictures");
-ok(gStorage, "Should have gotten a storage.");
-
-function createTestFile(path, callback) {
-  function addNamed() {
-    var req = gStorage.addNamed(createRandomBlob("image/png"), path);
-
-    req.onsuccess = function() {
-      ok(true, path + " was created.");
-      callback();
-    };
+var storage = navigator.getDeviceStorage("pictures");
+ok(storage, "Should have gotten a storage.");
 
-    req.onerror = function(e) {
-      ok(false, "Failed to create " + path + ": " + e.target.error.name);
-      devicestorage_cleanup();
-    };
-  }
-
-  // Bug 980136. Check if the file exists before we create.
-  var req = gStorage.get(path);
+// Create test files.
+var req = storage.addNamed(createRandomBlob("image/png"), "sub1/sub2/test.png");
 
-  req.onsuccess = function() {
-    ok(true, path + " exists. Do not need to create.");
-    callback();
-  };
-
-  req.onerror = function(e) {
-    ok(true, path + " does not exists: " + e.target.error.name);
-    addNamed();
-  };
-}
-
-createTestFile("sub1/sub2/test.png", function() {
-  var promise = gStorage.getRoot();
+req.onsuccess = function() {
+  var promise = storage.getRoot();
   ok(promise, "Should have a non-null promise for getRoot.");
   promise.then(getSuccess, cbError);
-});
+};
+
+
+req.onerror = function() {
+  ok(false, "Failed to created test files.");
+  devicestorage_cleanup();
+};
 
 </script>
 </pre>
 </body>
 </html>