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

Side by Side Diff: third_party/WebKit/LayoutTests/netinfo/unregister-during-event.html

Issue 2087293003: [DevTools] Network.emulateNetworkConditions now affects NetworkStateNotifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: proper initialized checks 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 8
9 description("Tests that it's okay to unregister the event listener while handlin g the event."); 9 description("Tests that it's okay to unregister the event listener while handlin g the event.");
10 10
11 shouldBe('typeof window.internals.observeGC', '"function"', 11 shouldBe('typeof window.internals.observeGC', '"function"',
12 'this test requires window.internals'); 12 'this test requires window.internals');
13 13
14 var otherHandler = function(e) { 14 var otherHandler = function(e) {
15 shouldBe('connection.type', 'initialType'); 15 shouldBe('connection.type', 'initialType');
16 shouldBe('connection.downlinkMax', 'initialDownlinkMax'); 16 shouldBe('connection.downlinkMax', 'initialDownlinkMax');
17 17
18 finishJSTest(); 18 finishJSTest();
19 }; 19 };
20 20
21 var handler = function(e) { 21 var handler = function(e) {
22 shouldBe('connection.type', 'newConnectionType'); 22 shouldBe('connection.type', 'newConnectionType');
23 shouldBe('connection.downlinkMax', 'newDownlinkMax'); 23 shouldBe('connection.downlinkMax', 'newDownlinkMax');
24 connection.removeEventListener('change', handler); 24 connection.removeEventListener('change', handler);
25 connection.addEventListener('change', otherHandler); 25 connection.addEventListener('change', otherHandler);
26 internals.setNetworkConnectionInfo(initialType, initialDownlinkMax); 26 internals.setNetworkConnectionInfoOverride(isTypeOnline(initialType), initia lType, initialDownlinkMax);
27 }; 27 };
28 28
29 connection.addEventListener('change', handler); 29 connection.addEventListener('change', handler);
30 internals.setNetworkConnectionInfo(newConnectionType, newDownlinkMax); 30 internals.setNetworkConnectionInfoOverride(isTypeOnline(newConnectionType), newC onnectionType, newDownlinkMax);
31 31
32 </script> 32 </script>
33 </body> 33 </body>
34 </html> 34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698