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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <body> 2 <body>
3 <head> 3 <head>
4 <script src="../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <script src="vibration-utils.js"></script>
6 </head> 5 </head>
7 <script> 6 <script>
8 description("Accessing navigator.vibrate on a closed window."); 7 description("Accessing FileReader when in a detached state.");
9 8
10 window.jsTestIsAsync = true; 9 window.jsTestIsAsync = true;
11 10
12 var w; 11 var w;
12 var fileReader;
13 function processMessage(event) { 13 function processMessage(event) {
14 if (event.data == "opened") { 14 if (event.data == "opened") {
15 fileReader = new w.FileReader();
15 w.close(); 16 w.close();
16 } else if (event.data == "closed") { 17 } else if (event.data == "closed") {
17 shouldBeFalse("w.navigator.vibrate([])"); 18 shouldThrow("fileReader.readAsArrayBuffer(new File(['hello'], 'world.htm l'))");
18 finishJSTest(); 19 finishJSTest();
19 } 20 }
20 } 21 }
21 22
22 if (window.testRunner) { 23 if (window.testRunner) {
23 testRunner.dumpAsText(); 24 testRunner.dumpAsText();
24 testRunner.setCanOpenWindows(); 25 testRunner.setCanOpenWindows();
25 } 26 }
26 w = window.open('resources/vibration-detached-no-crash-new-window.html'); 27 w = window.open('resources/file-reader-detached-no-crash-new-window.html');
27 window.addEventListener("message", processMessage, false); 28 window.addEventListener("message", processMessage, false);
28 </script> 29 </script>
29 </body> 30 </body>
OLDNEW
« 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