Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: LayoutTests/plugins/plugin-cancel-sync-xhr.html

Issue 1129743002: Gracefully handle backdoor cancellations of synchronous resource fetches. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/plugins/plugin-cancel-sync-xhr-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/plugins/plugin-cancel-sync-xhr-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698