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

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

Issue 1381613003: Defer media loading while on cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 2 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..efaa164b0623189666756b98673d44213f06bb8d 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.addEventListener('beforeunload', function() {
+ internals.setNetworkStateNotifierTestOnly(false);
+ }, false);
}

Powered by Google App Engine
This is Rietveld 408576698