mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Update web-platform-tests to revision 71e901cf4534417abfabe4d77a317817f5cc09db
This commit is contained in:
parent
7c34a70ca8
commit
0bc27d4696
48 changed files with 1125 additions and 147 deletions
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>DataTransferItem Test: getAsString()</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<p><input type="text" value="dragcharacters" style="border:2px blue solid; width:200px; height: 100px;"/></p>
|
||||
<p><input id="container" type="text" style="border:2px green solid; width:200px; height: 100px;"/></p>
|
||||
|
||||
<p>Select all characters in blue box and drag to green box then drop on the green box</p>
|
||||
|
||||
<script>
|
||||
|
||||
setup({explicit_done : true, explicit_timeout : true});
|
||||
|
||||
let container = document.getElementById("container");
|
||||
|
||||
on_event(container, "drop", evt => {
|
||||
let item = evt.dataTransfer.items[0];
|
||||
|
||||
test(() => {
|
||||
let file1 = item.getAsFile();
|
||||
assert_equals(file1, null);
|
||||
}, "Check if DataTransferItem.getAsFile return null if drag data item kind is not File");
|
||||
|
||||
let data;
|
||||
item.getAsString(str => {
|
||||
data = str;
|
||||
});
|
||||
setTimeout(() => {
|
||||
test(() => {
|
||||
assert_equals(data, "dragcharacters");
|
||||
}, "Check if DataTransferItem.getAsString return the dragged string");
|
||||
done();
|
||||
}, 0);
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue