Bug 1607791 - Get rid of IDBMutableFile.getFile() - part 4 - Remove a few tests, r=janv
☠☠ backed out by 0bb7d3150587 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 15 Jan 2020 10:15:42 +0000
changeset 510327 f15835338319b31529057f4e64b5310d906576de
parent 510326 4c92f506cf62ca943a9ab14946e065e6ba28b4f3
child 510328 37026beadbd8141d18495386503e2eb64fda02d3
push id37020
push userccoroiu@mozilla.com
push dateWed, 15 Jan 2020 21:36:21 +0000
treeherdermozilla-central@c35bb210b8ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanv
bugs1607791
milestone74.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 1607791 - Get rid of IDBMutableFile.getFile() - part 4 - Remove a few tests, r=janv Differential Revision: https://phabricator.services.mozilla.com/D59143
dom/indexedDB/test/mochitest.ini
dom/indexedDB/test/test_filehandle_getFile.html
dom/indexedDB/test/test_filehandle_store_snapshot.html
dom/indexedDB/test/test_filehandle_stream_tracking.html
dom/indexedDB/test/test_filehandle_workers.html
--- a/dom/indexedDB/test/mochitest.ini
+++ b/dom/indexedDB/test/mochitest.ini
@@ -171,30 +171,26 @@ skip-if = verify
 skip-if = toolkit == 'android' && !is_fennec
 [test_file_resurrection_transaction_abort.html]
 skip-if = toolkit == 'android' && !is_fennec
 [test_file_sharing.html]
 [test_file_transaction_abort.html]
 [test_filehandle_append_read_data.html]
 [test_filehandle_compat.html]
 [test_filehandle_disabled_pref.html]
-[test_filehandle_getFile.html]
-skip-if = true
 [test_filehandle_iteration.html]
 [test_filehandle_lifetimes.html]
 [test_filehandle_lifetimes_nested.html]
 [test_filehandle_location.html]
 [test_filehandle_ordering.html]
 [test_filehandle_overlapping.html]
 [test_filehandle_progress_events.html]
 [test_filehandle_readonly_exceptions.html]
 [test_filehandle_request_readyState.html]
 [test_filehandle_serialization.html]
-[test_filehandle_store_snapshot.html]
-[test_filehandle_stream_tracking.html]
 [test_filehandle_success_events_after_abort.html]
 [test_filehandle_truncate.html]
 [test_filehandle_workers.html]
 [test_filehandle_write_read_data.html]
 [test_getAll.html]
 [test_getFileId.html]
 [test_globalObjects_content.html]
 [test_global_data.html]
deleted file mode 100644
--- a/dom/indexedDB/test/test_filehandle_getFile.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<html>
-<head>
-  <title>File Handle Test</title>
-
-  <script src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-
-  <script type="text/javascript">
-  function* testSteps()
-  {
-    const name = window.location.pathname;
-
-    let request = indexedDB.open(name, 1);
-    request.onerror = errorHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    request = db.createMutableFile("test.txt");
-    request.onerror = errorHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    let mutableFile = event.target.result;
-    mutableFile.onerror = errorHandler;
-
-    request = mutableFile.getFile();
-    ok(request instanceof DOMRequest, "Correct interface");
-    ok(!(request instanceof IDBFileRequest), "Correct interface");
-    ok(!("fileHandle" in request), "Property should not exist");
-    ok(request.fileHandle === undefined, "Property should not exist");
-    ok(!("lockedFile" in request), "Property should not exist");
-    ok(request.lockedFile === undefined, "Property should not exist");
-    ok(!("onprogress" in request), "Property should not exist");
-    ok(request.onprogress === undefined, "Property should not exist");
-
-    finishTest();
-  }
-  </script>
-  <script type="text/javascript" src="helpers.js"></script>
-
-</head>
-
-<body onload="runTest();"></body>
-
-</html>
deleted file mode 100644
--- a/dom/indexedDB/test/test_filehandle_store_snapshot.html
+++ /dev/null
@@ -1,97 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<html>
-<head>
-  <title>Indexed Database Property Test</title>
-
-  <script src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-
-  <script type="text/javascript">
-  function* testSteps()
-  {
-    const READ_WRITE = "readwrite";
-
-    const name = window.location.pathname;
-
-    const objectStoreName = "Blobs";
-
-    const testFile = getRandomFile("random.bin", 100000);
-
-    let request = indexedDB.open(name, 1);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Got correct event type");
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let objectStore = db.createObjectStore(objectStoreName, { });
-
-    event = yield undefined;
-
-    is(event.type, "success", "Got correct event type");
-
-    request = db.createMutableFile("random.bin", "binary/random");
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    let mutableFile = event.target.result;
-    mutableFile.onerror = errorHandler;
-
-    let fileHandle = mutableFile.open("readwrite");
-
-    is(getFileId(mutableFile), 1, "Correct file id");
-
-    request = fileHandle.write(testFile);
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    request = mutableFile.getFile();
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    let file = event.target.result;
-
-    let trans = db.transaction([objectStoreName], READ_WRITE);
-    objectStore = trans.objectStore(objectStoreName);
-
-    request = objectStore.add(file, 42);
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    // At this moment, the file should not be readable anymore.
-    let reader = new FileReader();
-    try {
-      reader.readAsArrayBuffer(file);
-      ok(false, "Should have thrown!");
-    }
-    catch (e) {
-      ok(e instanceof DOMException, "Got exception.");
-      is(e.name, "FileHandleInactiveError", "Good error.");
-      is(e.code, 0, "Good error code.");
-    }
-
-    request = objectStore.get(42);
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    verifyBlob(event.target.result, testFile, 2);
-    yield undefined;
-
-    finishTest();
-  }
-  </script>
-  <script type="text/javascript" src="file.js"></script>
-  <script type="text/javascript" src="helpers.js"></script>
-
-</head>
-
-<body onload="runTest();"></body>
-
-</html>
deleted file mode 100644
--- a/dom/indexedDB/test/test_filehandle_stream_tracking.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<html>
-<head>
-  <title>File Handle Test</title>
-
-  <script src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-
-  <script type="text/javascript">
-  function* testSteps()
-  {
-    const name = window.location.pathname;
-
-    var testBuffer = getRandomBuffer(100000);
-
-    let request = indexedDB.open(name, 1);
-    request.onerror = errorHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    request = db.createMutableFile("test.txt");
-    request.onerror = errorHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    let mutableFile = event.target.result;
-    mutableFile.onerror = errorHandler;
-
-    let fileHandle = mutableFile.open("readwrite");
-
-    request = fileHandle.write(testBuffer);
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    request = mutableFile.getFile();
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    let file = event.target.result;
-
-    let resultBuffer1;
-    let resultBuffer2;
-
-    let reader1 = new FileReader();
-    reader1.readAsArrayBuffer(file);
-    reader1.onerror = errorHandler;
-    reader1.onload = function(event)
-    {
-      resultBuffer1 = event.target.result;
-
-      let reader = new FileReader();
-      try {
-        reader.readAsArrayBuffer(file);
-        ok(false, "Should have thrown!");
-      }
-      catch (e) {
-        ok(e instanceof DOMException, "Got exception.");
-        is(e.name, "FileHandleInactiveError", "Good error.");
-        is(e.code, 0, "Good error code.");
-      }
-
-      if (resultBuffer2) {
-        testGenerator.next();
-      }
-    };
-
-    let reader2 = new FileReader();
-    reader2.readAsArrayBuffer(file);
-    reader2.onerror = errorHandler;
-    reader2.onload = function(event)
-    {
-      resultBuffer2 = event.target.result;
-
-      let reader = new FileReader();
-      try {
-        reader.readAsArrayBuffer(file);
-        ok(false, "Should have thrown!");
-      }
-      catch (e) {
-        ok(e instanceof DOMException, "Got exception.");
-        is(e.name, "FileHandleInactiveError", "Good error.");
-        is(e.code, 0, "Good error code.");
-      }
-
-      if (resultBuffer1) {
-        testGenerator.next();
-      }
-    };
-
-    yield undefined;
-
-    ok(compareBuffers(resultBuffer1, testBuffer), "Correct data");
-    ok(compareBuffers(resultBuffer2, testBuffer), "Correct data");
-
-    finishTest();
-  }
-  </script>
-  <script type="text/javascript" src="file.js"></script>
-  <script type="text/javascript" src="helpers.js"></script>
-
-</head>
-
-<body onload="runTest();"></body>
-
-</html>
--- a/dom/indexedDB/test/test_filehandle_workers.html
+++ b/dom/indexedDB/test/test_filehandle_workers.html
@@ -66,34 +66,16 @@
     mutableFile.onerror = errorHandler;
 
     let fileHandle = mutableFile.open("readwrite");
 
     request = fileHandle.write(testBuffer);
     request.onsuccess = grabEventAndContinueHandler;
     event = yield undefined;
 
-    request = mutableFile.getFile();
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    let file = event.target.result;
-
-    let worker2 = new Worker(url);
-    URL.revokeObjectURL(url);
-    try {
-      worker2.postMessage(file);
-      ok(false, "Should have thrown!");
-    }
-    catch (e) {
-      ok(e instanceof DOMException, "Got exception.");
-      is(e.name, "DataCloneError", "Good error.");
-      is(e.code, DOMException.DATA_CLONE_ERR, "Good error code.");
-    }
-
     let objectStore =
       db.transaction("Foo", "readwrite").objectStore("Foo");
 
     request = objectStore.add(mutableFile, 42);
     request.onsuccess = grabEventAndContinueHandler;
     event = yield undefined;
 
     function workerScript() {
@@ -121,28 +103,27 @@
         request.onerror = function(event) {
           postMessage("error");
         };
       };
     }
 
     url = URL.createObjectURL(new Blob(["(", workerScript.toString(), ")()"]));
 
-    let worker3 = new Worker(url);
+    let worker2 = new Worker(url);
     URL.revokeObjectURL(url);
-    worker3.postMessage(name);
-    worker3.onmessage = grabEventAndContinueHandler;
+    worker2.postMessage(name);
+    worker2.onmessage = grabEventAndContinueHandler;
     event = yield undefined;
 
     is(event.data, "success", "Good response.");
 
     todo(false, "Terminate all workers at the end of the test to work around bug 1340941.");
     worker1.terminate();
     worker2.terminate();
-    worker3.terminate();
 
     finishTest();
   }
   </script>
   <script type="text/javascript" src="file.js"></script>
   <script type="text/javascript" src="helpers.js"></script>
 
 </head>