| Index: third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block-effectively-2g.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-block-effectively-2g.html
|
| similarity index 67%
|
| 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-block-effectively-2g.html
|
| index e5ec3b8f074668594ffa14a053c3e42423fb0893..d0fc50a001c514dc039854ab9b9fd5ee6eee7458 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-block-effectively-2g.html
|
| @@ -5,21 +5,22 @@
|
| var src = 'http://localhost:8000/loading/resources/js-loaded.js?conn-type';
|
| var jsLoaded = false;
|
| var loadSuccess = false;
|
| - if (window.internals) {
|
| - internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections(true);
|
| + if (window.internals && window.testRunner) {
|
| + internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameIfEffectively2G(true);
|
| internals.setNetworkConnectionInfoOverride(true, 'cellular3g', 2.0);
|
| internals.evictAllResources();
|
| -
|
| + window.testRunner.setEffectiveConnectionType('TypeSlow2G');
|
| window.addEventListener('beforeunload', function() {
|
| internals.clearNetworkConnectionInfoOverride();
|
| - internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections(false);
|
| + window.testRunner.setEffectiveConnectionType('TypeUnknown');
|
| + internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameIfEffectively2G(false);
|
| }, false);
|
| }
|
| document.write('<scr' + 'ipt src="' + src + '" onload="loadSuccess=true"></scr' + 'ipt>');
|
| </script>
|
| <script>
|
| test(function () {
|
| - assert_true(jsLoaded);
|
| - assert_true(loadSuccess);
|
| - }, "Document.written scripts are not blocked in a fast connection");
|
| + assert_false(jsLoaded);
|
| + assert_false(loadSuccess);
|
| + }, "Document.written scripts are blocked when effectively 2G");
|
| </script>
|
|
|