Commit 4a20ea3d authored by kdillon's avatar kdillon Committed by Commit Bot

Adding a test for AllowSyncXHRInPageDismissal Origin Trial.

Change-Id: I9236718df91559319cc1e52992713a1ee0112952
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1822877Reviewed-by: default avatarJason Chase <chasej@chromium.org>
Commit-Queue: Katie Dillon <kdillon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708875}
parent 33ec60e1
<!DOCTYPE html>
<meta charset="utf-8">
<!--- Generate token with the command:
tools/origin_trials/generate_token.py http://127.0.0.1:8000 AllowSyncXHRInPageDismissal --expire-timestamp=2000000000
- --->
<meta http-equiv="origin-trial" content="AqLbn6J2A0k+teF1WJA9pid0csRR356z7Gcnoq7hfegRNL3A5sf/FNTSgitsYD+bTG1q1iFshX9QvbT/yKJUoAkAAABjeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQWxsb3dTeW5jWEhSSW5QYWdlRGlzbWlzc2FsIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9">
<head>
<script>
addEventListener("unload", function() {
try {
var xhr = new XMLHttpRequest();
xhr.open('GET', '', false);
xhr.send(null);
parent.xhr_fired = true;
} catch (e) {
parent.xhr_fired = false;
}
parent.start_test();
});
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<body>
<title>Test behavior of sync XHR during unload</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var t = async_test();
var xhr_fired = false;
function start_test() {
step_timeout(t.step_func(function() {
assert_true(xhr_fired);
t.done();
}), 1000);
}
onload = function() {
setTimeout(function() {
var iframe = document.getElementById("ifr")
iframe.src = "about:blank";
}, 100)
}
</script>
<iframe id="ifr" name="ifr" src="resources/sync-xhr-in-page-dismissal.html"></iframe>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment