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

Unified Diff: third_party/WebKit/LayoutTests/netinfo/resources/netinfo_common.js

Issue 1276143002: Defer media loading while on cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup. Created 5 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/netinfo/resources/netinfo_common.js
diff --git a/third_party/WebKit/LayoutTests/netinfo/resources/netinfo_common.js b/third_party/WebKit/LayoutTests/netinfo/resources/netinfo_common.js
index 57e3c45dbb900469f8e26a8143963197d5680536..49562951fdadbf566d9415b65f6d026611d6ff5c 100644
--- a/third_party/WebKit/LayoutTests/netinfo/resources/netinfo_common.js
+++ b/third_party/WebKit/LayoutTests/netinfo/resources/netinfo_common.js
@@ -10,5 +10,10 @@ var newDownlinkMax = 2.0;
if (window.internals) {
internals.setNetworkStateNotifierTestOnly(true);
internals.setNetworkConnectionInfo(initialType, initialDownlinkMax);
+
+ // Reset the state of the singleton network state notifier.
+ window.onbeforeunload = function() {
+ internals.setNetworkStateNotifierTestOnly(false);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698