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

Unified Diff: LayoutTests/netinfo/gc-used-listeners.html

Issue 291203002: Adds NetInfo v3 Web API to Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@netinfo1
Patch Set: Comment typo 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/netinfo/gc-used-listeners.html
diff --git a/LayoutTests/netinfo/gc-used-listeners.html b/LayoutTests/netinfo/gc-used-listeners.html
new file mode 100644
index 0000000000000000000000000000000000000000..2b5e81b47206c52eaf6c93b3c9e94305ba0800d0
--- /dev/null
+++ b/LayoutTests/netinfo/gc-used-listeners.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="resources/netinfo_common.js"></script>
+</head>
+<body>
+<script>
+
+description('Tests that used listeners are not collected.');
+
+shouldBe('typeof window.internals.observeGC', '"function"',
+'this test requires window.internals');
+
+var callback = function(e) {
+ testFailed("Should not get here.");
+};
+
+// Add a listener and make sure that the callback
+// doesn't get collected.
+var callbackObserver = internals.observeGC(callback);
+connection.addEventListener('typechange', callback);
+callback = null;
+gc();
+shouldBeFalse('callbackObserver.wasCollected');
+finishJSTest();
+
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/netinfo/gc-unused-listeners-expected.txt ('k') | LayoutTests/netinfo/gc-used-listeners-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698