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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block-effectively-2g.html

Issue 2338623004: Add Blink setting to block doc.written scripts on 2g-like networks (Closed)
Patch Set: Update test results after rebase Created 4 years, 3 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
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>

Powered by Google App Engine
This is Rietveld 408576698