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

Side by Side Diff: third_party/WebKit/LayoutTests/netinfo/basic-operation.html

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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <script src="../resources/js-test.js"></script> 3 <script src="../resources/js-test.js"></script>
4 <script src="resources/netinfo_common.js"></script> 4 <script src="resources/netinfo_common.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description('Tests the basic operation of NetInfo.'); 8 description('Tests the basic operation of NetInfo.');
9 9
10 shouldBe('typeof window.internals.observeGC', '"function"', 10 shouldBe('typeof window.internals.observeGC', '"function"',
11 'this test requires window.internals'); 11 'this test requires window.internals');
12 12
13 shouldBeDefined("navigator.connection"); 13 shouldBeDefined("navigator.connection");
14 shouldBeDefined("navigator.connection.type"); 14 shouldBeDefined("navigator.connection.type");
15 shouldBeDefined("navigator.connection.downlinkMax"); 15 shouldBeDefined("navigator.connection.downlinkMax");
16 16
17 var typeChangeListener = function(e) { 17 var typeChangeListener = function(e) {
18 shouldBe("typeof connection.type", '"string"'); 18 shouldBe("typeof connection.type", '"string"');
19 shouldBe('connection.type', 'initialType'); 19 shouldBe('connection.type', 'initialType');
20 shouldBe('connection.downlinkMax', 'initialDownlinkMax'); 20 shouldBe('connection.downlinkMax', 'initialDownlinkMax');
21 finishJSTest(); 21 finishJSTest();
22 } 22 }
23 23
24 var changeListener = function(e) { 24 var changeListener = function(e) {
25 shouldBe("typeof connection.type", '"string"'); 25 shouldBe("typeof connection.type", '"string"');
26 shouldBe('connection.type', 'newConnectionType'); 26 shouldBe('connection.type', 'newConnectionType');
27 shouldBe('connection.downlinkMax', 'newDownlinkMax'); 27 shouldBe('connection.downlinkMax', 'newDownlinkMax');
28 connection.removeEventListener('change', changeListener); 28 connection.removeEventListener('change', changeListener);
29 connection.addEventListener('typechange', typeChangeListener); 29 connection.addEventListener('typechange', typeChangeListener);
30 » internals.setNetworkConnectionInfo(initialType, initialDownlinkMax); 30 » internals.setNetworkConnectionInfoOverride(isTypeOnline(initialType), in itialType, initialDownlinkMax);
31 } 31 }
32 32
33 connection.addEventListener('change', changeListener); 33 connection.addEventListener('change', changeListener);
34 internals.setNetworkConnectionInfo(newConnectionType, newDownlinkMax); 34 internals.setNetworkConnectionInfoOverride(isTypeOnline(newConnectionType), newC onnectionType, newDownlinkMax);
35 35
36 </script> 36 </script>
37 </body> 37 </body>
38 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698