Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-no-cache.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-conn-type.html b/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-no-cache.html |
| similarity index 56% |
| copy from third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-conn-type.html |
| copy to third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-no-cache.html |
| index 2123f921f1eead7b856f3f0eb308f8648ce93eb9..f6e2e1fefc66ad16e8984268fa277137573f0e5b 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-conn-type.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-no-cache.html |
| @@ -2,25 +2,35 @@ |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script> |
| - var src = 'http://localhost:8000/loading/resources/js-loaded.js'; |
| - var jsLoaded = false; |
| - var loadSuccess = false; |
| if (window.internals) { |
| internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections(true); |
| internals.setNetworkStateNotifierTestOnly(true); |
| - internals.setNetworkConnectionInfo('cellular3g', 2.0); |
| + internals.setNetworkConnectionInfo('cellular2g', 1.0); |
| internals.evictAllResources(); |
| + // Reset the state of the singleton network state notifier. |
| window.addEventListener('beforeunload', function() { |
| - internals.setNetworkStateNotifierTestOnly(false); |
| internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections(false); |
| + internals.setNetworkStateNotifierTestOnly(false); |
| }, false); |
| } |
| - document.write('<scr' + 'ipt src="' + src + '" onload="loadSuccess=true"></scr' + 'ipt>'); |
| + |
| + var crossOrigin = 'http://localhost:8000' |
| + var filePath = '/loading/resources/js-loaded.js' |
| + var jsLoaded = false; |
| + var loadSuccess = false; |
| + |
| + // First time the script will be blocked and onError will reload the page. |
| + // On reload the script should not be blocked and thus the subsequent asserts |
| + // will be true. |
| + // forceReload(true) sets the reload to bypass cache. |
| + src = crossOrigin + filePath; |
| + document.write('<scr' + 'ipt src="' + src + '" onload="loadSuccess=true" onError="internals.forceReload(true)"></scr' + 'ipt>'); |
|
jkarlin
2016/04/13 18:38:36
This whole file is a copy of the other except for
shivanisha
2016/04/14 17:59:55
done.
|
| </script> |
| + |
| <script> |
| test(function () { |
| assert_true(jsLoaded); |
| assert_true(loadSuccess); |
| - }, "Document.written scripts are not blocked in a fast connection"); |
| + }, "cross origin doc.written scripts are not blocked in a page reload"); |
| </script> |