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

Side by Side Diff: LayoutTests/imported/web-platform-tests/FileAPI/reading-data-section/filereader_abort.html

Issue 1236713002: Import FileAPI tests from web-platform-tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ugh, stupid baselines Created 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>FileAPI Test: filereader_abort</title>
6 <link rel="author" title="Intel" href="http://www.intel.com">
7 <link rel="help" href="http://dev.w3.org/2006/webapi/FileAPI/#abort">
8 <script src="../../../../resources/testharness.js"></script>
9 <script src="../../../../resources/testharnessreport.js"></script>
10 </head>
11 <body>
12 <div id="log"></div>
13
14 <script>
15 test(function() {
16 var readerNoRead = new FileReader();
17 readerNoRead.abort();
18 assert_equals(readerNoRead.readyState, readerNoRead.EMPTY);
19 assert_equals(readerNoRead.result, null);
20 }, "Aborting before read");
21
22 async_test(function() {
23 var blob = new Blob(["TEST THE ABORT METHOD"]);
24 var readerAbort = new FileReader();
25
26 readerAbort.onabort = this.step_func(function(evt) {
27 assert_equals(readerAbort.readyState, readerAbort.DONE);
28 });
29
30 readerAbort.onloadstart = this.step_func(function(evt) {
31 assert_equals(readerAbort.readyState, readerAbort.LOADING);
32 readerAbort.abort();
33 });
34
35 readerAbort.onloadend = this.step_func(function(evt) {
36 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=24401
37 assert_equals(readerAbort.result, null);
38 assert_equals(readerAbort.readyState, readerAbort.DONE);
39 this.done();
40 });
41
42 readerAbort.readAsText(blob);
43 }, "Aborting after read");
44 </script>
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698