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

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

Issue 291203002: Adds NetInfo v3 Web API to Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@netinfo1
Patch Set: Simplified layout tests Created 6 years, 7 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
(Empty)
1 <html>
2 <head>
3 <script src="../resources/js-test.js"></script>
4 <script src="resources/netinfo_common.js"></script>
5 </head>
6 <body>
7 <script>
8
9 description("Tests that it's okay to unregister the event listener while handlin g the event.");
10
11 var otherHandler = function(e) {
12 if (connection.type != initialType)
13 testFailed("The connection type did not revert.");
14 finishJSTest();
15 };
16
17 var handler = function(e) {
18 if (connection.type != newConnectionType)
19 testFailed("The connection type did not change.");
20 connection.removeEventListener('typechange', handler);
21 connection.addEventListener('typechange', otherHandler);
22 internals.setNetworkConnectionInfo(initialType);
23 };
24
25 connection.addEventListener('typechange', handler);
26 internals.setNetworkConnectionInfo(newConnectionType);
27
28 </script>
29 </body>
30 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698