test_filehandle_getFile.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!--
  2. Any copyright is dedicated to the Public Domain.
  3. http://creativecommons.org/publicdomain/zero/1.0/
  4. -->
  5. <html>
  6. <head>
  7. <title>File Handle Test</title>
  8. <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  10. <script type="text/javascript;version=1.7">
  11. function testSteps()
  12. {
  13. const name = window.location.pathname;
  14. let request = indexedDB.open(name, 1);
  15. request.onerror = errorHandler;
  16. request.onsuccess = grabEventAndContinueHandler;
  17. let event = yield undefined;
  18. let db = event.target.result;
  19. db.onerror = errorHandler;
  20. request = db.createMutableFile("test.txt");
  21. request.onerror = errorHandler;
  22. request.onsuccess = grabEventAndContinueHandler;
  23. event = yield undefined;
  24. let mutableFile = event.target.result;
  25. mutableFile.onerror = errorHandler;
  26. request = mutableFile.getFile();
  27. ok(request instanceof DOMRequest, "Correct interface");
  28. ok(!(request instanceof IDBFileRequest), "Correct interface");
  29. ok(!('fileHandle' in request), "Property should not exist");
  30. ok(request.fileHandle === undefined, "Property should not exist");
  31. ok(!('lockedFile' in request), "Property should not exist");
  32. ok(request.lockedFile === undefined, "Property should not exist");
  33. ok(!('onprogress' in request), "Property should not exist");
  34. ok(request.onprogress === undefined, "Property should not exist");
  35. finishTest();
  36. yield undefined;
  37. }
  38. </script>
  39. <script type="text/javascript;version=1.7" src="helpers.js"></script>
  40. </head>
  41. <body onload="runTest();"></body>
  42. </html>