Index: LayoutTests/plugins/plugin-cancel-sync-xhr.html |
diff --git a/LayoutTests/plugins/plugin-cancel-sync-xhr.html b/LayoutTests/plugins/plugin-cancel-sync-xhr.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cac3b8712db65f0b6ef8f86a29344a69b918fa74 |
--- /dev/null |
+++ b/LayoutTests/plugins/plugin-cancel-sync-xhr.html |
@@ -0,0 +1,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> |