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

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: Nit 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 71%
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..306458e329d45e6439ec4122a0f17f022fa4ca24 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
@@ -6,20 +6,22 @@
var jsLoaded = false;
var loadSuccess = false;
if (window.internals) {
- internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections(true);
+ internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameIfEffectively2G(true);
internals.setNetworkConnectionInfoOverride(true, 'cellular3g', 2.0);
+ internals.setEffectiveConnectionTypeOverride('TypeSlow2G');
internals.evictAllResources();
window.addEventListener('beforeunload', function() {
internals.clearNetworkConnectionInfoOverride();
- internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections(false);
+ internals.clearEffectiveConnectionTypeOverride();
+ 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