mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>File API Test: Progress Event - bubbles, cancelable</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/FileAPI/#events">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(function(){
|
||||
var blob = new Blob(["TEST"]);
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onloadstart = this.step_func(function(evt) {
|
||||
assert_false(evt.bubbles, "The bubbles must be false when the event is dispatched");
|
||||
assert_false(evt.cancelable, "The cancelable must be false when the event is dispatched");
|
||||
});
|
||||
|
||||
reader.onload = this.step_func(function(evt) {
|
||||
assert_false(evt.bubbles, "The bubbles must be false when the event is dispatched");
|
||||
assert_false(evt.cancelable, "The cancelable must be false when the event is dispatched");
|
||||
});
|
||||
|
||||
reader.onloadend = this.step_func(function(evt) {
|
||||
assert_false(evt.bubbles, "The bubbles must be false when the event is dispatched");
|
||||
assert_false(evt.cancelable, "The cancelable must be false when the event is dispatched");
|
||||
this.done();
|
||||
});
|
||||
|
||||
reader.readAsText(blob);
|
||||
}, "Check the values of bubbles and cancelable are false when the progress event is dispatched");
|
||||
</script>
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>FileReader Errors Test</title>
|
||||
<link rel=help href="http://dev.w3.org/2006/webapi/FileAPI/#convenienceAPI">
|
||||
<link rel=author title="Breezewish" href="mailto:me@breeswish.org">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<form name="upload">
|
||||
<input type="file" id="fileChooser"><br><input type="button" id="start" value="start">
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<p>Test steps:</p>
|
||||
<ol>
|
||||
<li>Download the <a href="support/file_test1.txt">file</a>.</li>
|
||||
<li>Select the file in the file inputbox.</li>
|
||||
<li>Delete the file.</li>
|
||||
<li>Click the 'start' button.</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<script>
|
||||
|
||||
var fileChooser = document.querySelector('#fileChooser');
|
||||
|
||||
setup({explicit_done: true});
|
||||
setup({explicit_timeout: true});
|
||||
|
||||
on_event(fileChooser, 'change', function() {
|
||||
|
||||
async_test(function(t) {
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.readAsArrayBuffer(fileChooser.files[0]);
|
||||
|
||||
reader.onloadend = t.step_func_done(function(event) {
|
||||
assert_equals(event.target.readyState, FileReader.DONE);
|
||||
assert_equals(reader.error, null);
|
||||
});
|
||||
|
||||
}, 'FileReader.error should be null if there are no errors when reading');
|
||||
|
||||
});
|
||||
|
||||
on_event(document.querySelector('#start'), 'click', function() {
|
||||
|
||||
async_test(function(t) {
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.readAsArrayBuffer(fileChooser.files[0]);
|
||||
|
||||
reader.onloadend = t.step_func_done(function(event) {
|
||||
assert_equals(event.target.readyState, FileReader.DONE);
|
||||
assert_equals(reader.error.code, 8);
|
||||
});
|
||||
|
||||
}, 'FileReader.error should be NOT_FOUND_ERR if the file is not found when reading');
|
||||
|
||||
done();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue