Chromium Code Reviews| 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..0c0c1d94e206c7d7600de067df60f4103b9b8e60 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block2.html |
| @@ -0,0 +1,26 @@ |
| +<!DOCTYPE html> |
|
jkarlin
2016/04/06 14:55:31
instead of ...-block2.html, how about ...-block-sy
|
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script> |
| + var t = async_test('Cross origin but asynchronous doc.written scripts are not blocked'); |
| + var src = 'http://localhost:8000/loading/resources/js-loaded1.js'; |
| + var jsLoaded = false; |
| + var loadSuccess = false; |
| + if (window.internals){ |
| + internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrame(true); |
| + internals.setNetworkStateNotifierTestOnly(true); |
| + internals.setNetworkConnectionInfo('cellular2g', 2.0); |
| + } |
| + document.write('<scr' + 'ipt src="' + src + '" onload="loadSuccess=true" async></scr' + 'ipt>'); |
| +</script> |
| +<script> |
| + window.addEventListener("load", t.step_func(function() { |
| + assert_true(loadSuccess, "Script loaded successfully"); |
| + assert_true(jsLoaded, "Cross origin but asynchronous doc.written scripts are not blocked"); |
| + t.done(); |
| + })); |
| + window.addEventListener('beforeunload', function() { |
| + internals.setNetworkStateNotifierTestOnly(false); |
| + internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrame(false); |
| + }, false); |
| +</script> |