Update web-platform-tests to revision 60220357131c65146444da1f54624d5b54d0975d

This commit is contained in:
WPT Sync Bot 2018-07-18 15:43:58 +00:00 committed by Tom Servo
parent c45192614c
commit 775b784f79
2144 changed files with 58115 additions and 29658 deletions

View file

@ -1,3 +1,4 @@
spec: https://w3c.github.io/requestidlecallback/
suggested_reviewers:
- farre
- rmcilroy

View file

@ -1,53 +0,0 @@
<!doctype html>
<meta charset=utf-8>
<title>idlharness test</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<pre id='untested_idl' style='display:none'>
[Global=Window, Exposed=Window]
interface Window {
};
</pre>
<pre id='idl'>
partial interface Window {
unsigned long requestIdleCallback(IdleRequestCallback callback,
optional IdleRequestOptions options);
void cancelIdleCallback(unsigned long handle);
};
dictionary IdleRequestOptions {
unsigned long timeout;
};
[Exposed=Window] interface IdleDeadline {
DOMHighResTimeStamp timeRemaining();
readonly attribute boolean didTimeout;
};
callback IdleRequestCallback = void (IdleDeadline deadline);
</pre>
<script>
var idl_array = new IdlArray();
idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);
idl_array.add_objects({Window: ["window"]});
async_test(function() {
var rIC = this.step_func(function(deadline) {
idl_array.add_objects({IdleDeadline: [deadline]});
idl_array.test();
this.done();
});
if (window.requestIdleCallback) {
requestIdleCallback(rIC);
} else {
idl_array.test();
assert_unreached("IdleDeadline not supported");
this.done();
}
}, "IdleDeadline object setup");
</script>

View file

@ -0,0 +1,30 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
async_test(function() {
const srcs = ['requestidlecallback', 'html', 'dom'];
Promise.all(srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())))
.then(([idl, html, dom]) => {
var idl_array = new IdlArray();
idl_array.add_idls(idl);
idl_array.add_dependency_idls(html);
idl_array.add_dependency_idls(dom);
idl_array.add_objects({Window: ['window']});
let deadline;
const execIDLTest = this.step_func_done(function() {
idl_array.add_objects({IdleDeadline: [deadline]});
idl_array.test();
});
if (!window.requestIdleCallback) {
execIDLTest();
} else {
const callback = this.step_func(d => {
deadline = d;
execIDLTest();
});
requestIdleCallback(callback, { timeout: 100 });
}
});
}, 'IdleDeadline object setup');