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

Unified Diff: chrome/browser/extensions/api/mdns/mdns_apitest.cc

Issue 1005903005: Cap chrome.mdns.onServiceList listeners per extension at 10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto HEAD and consolidate changes into one commit Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/common/extensions/api/mdns.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/mdns/mdns_apitest.cc
diff --git a/chrome/browser/extensions/api/mdns/mdns_apitest.cc b/chrome/browser/extensions/api/mdns/mdns_apitest.cc
index 61d10d33828e47d6f593a9f7134883af3610826f..80f6e8b5b35a002805c90244d378f307466d3c5d 100644
--- a/chrome/browser/extensions/api/mdns/mdns_apitest.cc
+++ b/chrome/browser/extensions/api/mdns/mdns_apitest.cc
@@ -142,3 +142,26 @@ IN_PROC_BROWSER_TEST_F(MDnsAPITest, MAYBE_RegisterMultipleListeners) {
dns_sd_registry_->DispatchMDnsEvent(test_service_type, services);
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
}
+
+// TODO(justinlin): Win Dbg has a workaround that makes RunExtensionSubtest
+// always return true without actually running the test. Remove when fixed.
+#if defined(OS_WIN) && !defined(NDEBUG)
+#define MAYBE_RegisterTooManyListeners DISABLED_RegisterTooManyListeners
+#else
+#define MAYBE_RegisterTooManyListeners RegisterTooManyListeners
+#endif
+// Test loading extension and registering multiple listeners.
+IN_PROC_BROWSER_TEST_F(MDnsAPITest, MAYBE_RegisterTooManyListeners) {
+ SetUpTestDnsSdRegistry();
+
+ EXPECT_CALL(*dns_sd_registry_, RegisterDnsSdListener(A<std::string>()))
+ .Times(10);
+ EXPECT_CALL(*dns_sd_registry_, UnregisterDnsSdListener(A<std::string>()))
+ .Times(10);
+ EXPECT_CALL(*dns_sd_registry_,
+ RemoveObserver(A<extensions::DnsSdRegistry::DnsSdObserver*>()))
+ .Times(1);
+
+ EXPECT_TRUE(RunPlatformAppTest("mdns/api-packaged-apps"))
+ << message_;
+}
« no previous file with comments | « no previous file | chrome/common/extensions/api/mdns.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698