Revision 45f38e4c17379c83be5533ff60697ac888d8eea7 authored by Frank Liberato on 21 September 2018, 18:34:39 UTC, committed by Blink WPT Bot on 21 September 2018, 18:44:44 UTC
This reverts commit 254369a5f6df06c2c6be067d14c2cb2a036ba173. Reason for revert: <INSERT REASONING HERE> Original change's description: > bindings: Implement timers with V8Function > > This fixes bug 866610 by using the IDL infrastructure to properly enter > the v8::Context before calling the registered callback. > > Also ensure eager finalization of ScheduledAction in DOMTimer to > prevent a memory leak. Added two more effective DCHECKs to confirm. > > Bug: 866610 > Change-Id: I37d7bd05f035fe31856cfe68bae51aa0632cd3b1 > Reviewed-on: https://chromium-review.googlesource.com/1220486 > Reviewed-by: Nate Chapin <japhet@chromium.org> > Reviewed-by: Yuki Shiino <yukishiino@chromium.org> > Reviewed-by: Hitoshi Yoshida <peria@chromium.org> > Commit-Queue: Timothy Gu <timothygu@chromium.org> > Cr-Commit-Position: refs/heads/master@{#593108} TBR=peria@chromium.org,yukishiino@chromium.org,haraken@chromium.org,japhet@chromium.org,timothygu@chromium.org Change-Id: Ifaccc3374466b851fc28b10c63ed1397bdae635e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 866610 Reviewed-on: https://chromium-review.googlesource.com/1239216 Reviewed-by: Frank Liberato <liberato@chromium.org> Commit-Queue: Frank Liberato <liberato@chromium.org> Cr-Commit-Position: refs/heads/master@{#593260}
1 parent 2719d8f
origin.htm
<!DOCTYPE html>
<meta charset=utf-8>
<title>Access-Control-Allow-Origin handling</title>
<link rel=help href=https://fetch.spec.whatwg.org/>
<meta name=author title="Odin Hørthe Omdal" href="mailto:odiho@opera.com">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=support.js?pipe=sub></script>
<h1>Access-Control-Allow-Origin handling</h1>
<div id=log></div>
<script>
/*
* Origin header
*/
function shouldPass(origin) {
test(function () {
var client = new XMLHttpRequest()
client.open('GET', CROSSDOMAIN
+ '/resources/cors-makeheader.py?origin='
+ encodeURIComponent(origin),
false)
client.send()
r = JSON.parse(client.response)
var host = location.protocol + "//" + location.host
assert_equals(r['origin'], host, 'Request Origin: should be ' + host)
}, 'Allow origin: ' + origin.replace(/\t/g, "[tab]").replace(/ /g, '_'));
}
shouldPass('*');
shouldPass(' * ');
shouldPass(' *');
shouldPass(location.protocol + "//" + location.host);
shouldPass(" "+location.protocol + "//" + location.host);
shouldPass(" "+location.protocol + "//" + location.host + " ");
shouldPass(" "+location.protocol + "//" + location.host);
function shouldFail(origin) {
test(function () {
var client = new XMLHttpRequest()
client.open('GET', CROSSDOMAIN
+ '/resources/cors-makeheader.py?origin='
+ encodeURIComponent(origin),
false)
assert_throws("NetworkError", function() { client.send() }, 'send')
}, 'Disallow origin: ' + origin.replace(/\0/g, "\\0"));
}
shouldFail(location.protocol + "//" + SUBDOMAIN + "." + location.host)
shouldFail("//" + location.host)
shouldFail("://" + location.host)
shouldFail("ftp://" + location.host)
shouldFail("http:://" + location.host)
shouldFail("http:/" + location.host)
shouldFail("http:" + location.host)
shouldFail(location.host)
shouldFail(location.protocol + "//" + location.host + "?")
shouldFail(location.protocol + "//" + location.host + "/")
shouldFail(location.protocol + "//" + location.host + " /")
shouldFail(location.protocol + "//" + location.host + "#")
shouldFail(location.protocol + "//" + location.host + "%23")
shouldFail(location.protocol + "//" + location.host + ":80")
shouldFail(location.protocol + "//" + location.host + ", *")
shouldFail(location.protocol + "//" + location.host + "\0")
shouldFail((location.protocol + "//" + location.host).toUpperCase())
shouldFail(location.protocol.toUpperCase() + "//" + location.host)
shouldFail("-")
shouldFail("**")
shouldFail("\0*")
shouldFail("*\0")
shouldFail("'*'")
shouldFail('"*"')
shouldFail("* *")
shouldFail("* null")
shouldFail("*" + location.protocol + "//" + "*")
shouldFail("*" + location.protocol + "//" + location.host)
shouldFail("* " + location.protocol + "//" + location.host)
shouldFail("*, " + location.protocol + "//" + location.host)
shouldFail("\0" + location.protocol + "//" + location.host)
shouldFail("null " + location.protocol + "//" + location.host)
shouldFail('http://example.net')
shouldFail('null')
shouldFail('null *')
shouldFail('')
shouldFail(location.href)
shouldFail(dirname(location.href))
shouldFail(CROSSDOMAIN)
shouldFail(location.host.replace(/^[^\.]+\./, ""))
shouldFail("." + location.host.replace(/^[^\.]+\./, ""))
shouldFail("*." + location.host.replace(/^[^\.]+\./, ""))
shouldFail("http://" + location.host.replace(/^[^\.]+\./, ""))
shouldFail("http://." + location.host.replace(/^[^\.]+\./, ""))
shouldFail("http://*." + location.host.replace(/^[^\.]+\./, ""))
function doubleOrigin(origin, origin2) {
test(function () {
var client = new XMLHttpRequest()
client.open('GET', CROSSDOMAIN
+ '/resources/cors-makeheader.py?origin='
+ encodeURIComponent(origin)
+ '&origin2=' + encodeURIComponent(origin2),
false)
assert_throws("NetworkError", function() { client.send() }, 'send')
}, 'Disallow multiple headers (' + origin + ', ' + origin2 + ')');
}
doubleOrigin('', '*');
doubleOrigin('*', '');
doubleOrigin('*', '*');
doubleOrigin('', location.protocol + "//" + location.host);
doubleOrigin('*', location.protocol + "//" + location.host);
doubleOrigin(location.protocol + "//" + location.host, location.protocol + "//" + location.host);
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...