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

Side by Side Diff: third_party/WebKit/LayoutTests/netinfo/resources/netinfo_common.js

Issue 2087293003: [DevTools] Network.emulateNetworkConditions now affects NetworkStateNotifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 window.jsTestIsAsync = true; 1 window.jsTestIsAsync = true;
2 2
3 var connection = navigator.connection; 3 var connection = navigator.connection;
4 var initialType = "bluetooth"; 4 var initialType = "bluetooth";
5 var initialDownlinkMax = 1.0; 5 var initialDownlinkMax = 1.0;
6 var newConnectionType = "ethernet"; 6 var newConnectionType = "ethernet";
7 var newDownlinkMax = 2.0; 7 var newDownlinkMax = 2.0;
8 8
9 // Suppress connection messages information from the host. 9 // Suppress connection messages information from the host.
10 if (window.internals) { 10 if (window.internals) {
11 internals.setNetworkStateNotifierTestOnly(true); 11 internals.setNetworkConnectionInfoOverride(true, initialType, initialDownlin kMax);
12 internals.setNetworkConnectionInfo(initialType, initialDownlinkMax);
13 12
14 // Reset the state of the singleton network state notifier. 13 // Reset the state of the singleton network state notifier.
15 window.addEventListener('beforeunload', function() { 14 window.addEventListener('beforeunload', function() {
16 internals.setNetworkStateNotifierTestOnly(false); 15 internals.clearNetworkConnectionInfoOverride();
17 }, false); 16 }, false);
18 } 17 }
19 18
19 function isTypeOnline(type) {
20 return type != 'none';
21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698