mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision c26470dac73f2df9d4822a0d3482f7eb1ebf57d9
This commit is contained in:
parent
7de87c487b
commit
4d3c932c47
648 changed files with 9014 additions and 4821 deletions
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>FileReader NotReadableError Test</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<link rel="help" href="https://w3c.github.io/FileAPI/#dfn-error-codes">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<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's readable permission.</li>
|
||||
<li>Click the 'start' button.</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
const fileChooser = document.querySelector('#fileChooser');
|
||||
|
||||
setup({explicit_done: true});
|
||||
setup({explicit_timeout: true});
|
||||
|
||||
on_event(document.querySelector('#start'), 'click', () => {
|
||||
async_test(t => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsArrayBuffer(fileChooser.files[0]);
|
||||
reader.onloadend = t.step_func_done(event => {
|
||||
assert_equals(event.target.readyState, FileReader.DONE);
|
||||
assert_equals(reader.error.name, "NotReadableError");
|
||||
});
|
||||
}, 'FileReader.error should be NotReadableError if the file is unreadable');
|
||||
done();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>FileReader SecurityError Test</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<link rel="help" href="https://w3c.github.io/FileAPI/#dfn-error-codes">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<form name="upload">
|
||||
<input type="file" id="fileChooser"><br><input type="button" id="start" value="start">
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<p>Test steps:</p>
|
||||
<ol>
|
||||
<li>Select a system sensitive file (e.g. files in /usr/bin, password files,
|
||||
and other native operating system executables) in the file inputbox.</li>
|
||||
<li>Click the 'start' button.</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
const fileChooser = document.querySelector('#fileChooser');
|
||||
|
||||
setup({explicit_done: true});
|
||||
setup({explicit_timeout: true});
|
||||
|
||||
on_event(document.querySelector('#start'), 'click', () => {
|
||||
async_test(t => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsArrayBuffer(fileChooser.files[0]);
|
||||
reader.onloadend = t.step_func_done(event => {
|
||||
assert_equals(event.target.readyState, FileReader.DONE);
|
||||
assert_equals(reader.error.name, "SecurityError");
|
||||
});
|
||||
}, 'FileReader.error should be SECURITY_ERROR if the file is a system sensitive file');
|
||||
done();
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue