Index: third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block2.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block2.html b/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block2.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e42d1063514746c3729f01ba0af60949a302771b |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block2.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE html> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script> |
+ var t = async_test('Makes sure synchronous third-party scripts in document.write are blocked'); |
+ var src = 'http://localhost:8000/loading/resources/js-loaded.js'; |
+ var jsLoaded = false; |
+ if (window.internals){ |
+ internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrame(true); |
+ internals.setNetworkStateNotifierTestOnly(true); |
+ internals.setNetworkConnectionInfo('cellular2g', 2.0); |
+ } |
+ document.write('<scr' + 'ipt src="' + src + '" async></scr' + 'ipt>'); |
+</script> |
+<script> |
+ window.addEventListener("load", t.step_func(function() { |
+ assert_true(jsLoaded, "third party but asynchronous doc.written scripts are not blocked"); |
+ t.done(); |
+ })); |
+ window.addEventListener('beforeunload', function() { |
+ internals.setNetworkStateNotifierTestOnly(false); |
+ internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrame(false); |
+ }, false); |
+</script> |