summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/plugins/plugin-cancel-sync-xhr.html
blob: cac3b8712db65f0b6ef8f86a29344a69b918fa74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<script src="../resources/js-test.js"></script>
<embed id="testPlugin" logfirstsetwindow="true" type="application/x-webkit-test-netscape">
<script>
description("Verify that sync XHRs cancelled by sync NPN message does not crash.");

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function runTest()
{
    var plugin = document.getElementById("testPlugin");
    var x = new XMLHttpRequest();
    x.open('GET', '/resources/not-there', false);
    // Injecting a call to Evaluate() here will cause the message
    // corresponding to logfirstsetwindow's "testRunner.notifyDone()",
    // to be synchronously handled during the sync XHR. Which in turn
    // triggers the cancellation of the load.
    plugin.testEvaluate("1+2;");
    x.send(null);
}
setTimeout(runTest, 1);
</script>