Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: LayoutTests/fast/files/file-reader-detached-no-crash.html

Issue 399863002: Gracefully handle FileReader() read operations when in a detached state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Throw AbortError (instead of InvalidStateError.) Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/files/file-reader-detached-no-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/files/file-reader-detached-no-crash.html
diff --git a/LayoutTests/vibration/vibration-detached-no-crash.html b/LayoutTests/fast/files/file-reader-detached-no-crash.html
similarity index 55%
copy from LayoutTests/vibration/vibration-detached-no-crash.html
copy to LayoutTests/fast/files/file-reader-detached-no-crash.html
index 46b12de5a54a8e51b7acdd480115bf094bb626f8..21e5757715e90e6251e93269cdb6f2139685f754 100644
--- a/LayoutTests/vibration/vibration-detached-no-crash.html
+++ b/LayoutTests/fast/files/file-reader-detached-no-crash.html
@@ -1,20 +1,21 @@
<!DOCTYPE HTML>
<body>
<head>
-<script src="../resources/js-test.js"></script>
-<script src="vibration-utils.js"></script>
+<script src="../../resources/js-test.js"></script>
</head>
<script>
-description("Accessing navigator.vibrate on a closed window.");
+description("Accessing FileReader when in a detached state.");
window.jsTestIsAsync = true;
var w;
+var fileReader;
function processMessage(event) {
if (event.data == "opened") {
+ fileReader = new w.FileReader();
w.close();
} else if (event.data == "closed") {
- shouldBeFalse("w.navigator.vibrate([])");
+ shouldThrow("fileReader.readAsArrayBuffer(new File(['hello'], 'world.html'))");
finishJSTest();
}
}
@@ -23,7 +24,7 @@ if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setCanOpenWindows();
}
-w = window.open('resources/vibration-detached-no-crash-new-window.html');
+w = window.open('resources/file-reader-detached-no-crash-new-window.html');
window.addEventListener("message", processMessage, false);
</script>
</body>
« no previous file with comments | « no previous file | LayoutTests/fast/files/file-reader-detached-no-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698