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

Unified Diff: extensions/browser/api/cast_channel/cast_channel_apitest.cc

Issue 2974523002: [cast_channel] Make CastSocketService a global leaky singleton (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/cast_channel/cast_channel_apitest.cc
diff --git a/extensions/browser/api/cast_channel/cast_channel_apitest.cc b/extensions/browser/api/cast_channel/cast_channel_apitest.cc
index 1639bf609142783f6d28f20634ab6e7747fc4c4b..2579426df59cad6a2815b27d56749c4add7af487 100644
--- a/extensions/browser/api/cast_channel/cast_channel_apitest.cc
+++ b/extensions/browser/api/cast_channel/cast_channel_apitest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/ui/browser.h"
#include "components/cast_channel/cast_socket.h"
#include "components/cast_channel/cast_socket_service.h"
-#include "components/cast_channel/cast_socket_service_factory.h"
#include "components/cast_channel/cast_test_util.h"
#include "components/cast_channel/logger.h"
#include "components/cast_channel/proto/cast_channel.pb.h"
@@ -145,8 +144,11 @@ class CastChannelAPITest : public ExtensionApiTest {
.WillOnce(Return(ReadyState::OPEN))
.RetiresOnSaturation();
EXPECT_CALL(*mock_cast_socket_, ready_state())
- .WillOnce(Return(ReadyState::CLOSED));
+ .Times(2)
+ .WillRepeatedly(Return(ReadyState::CLOSED));
}
+ EXPECT_CALL(*mock_cast_socket_, Close(_))
+ .WillOnce(InvokeCompletionCallback<0>(net::OK));
}
extensions::CastChannelAPI* GetApi() {
@@ -154,9 +156,7 @@ class CastChannelAPITest : public ExtensionApiTest {
}
cast_channel::CastSocketService* GetCastSocketService() {
- return cast_channel::CastSocketServiceFactory::GetForBrowserContext(
- profile())
- .get();
+ return cast_channel::CastSocketService::GetInstance();
}
// Logs some bogus error details and calls the OnError handler.

Powered by Google App Engine
This is Rietveld 408576698