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

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

Issue 2974523002: [cast_channel] Make CastSocketService a global leaky singleton (Closed)
Patch Set: merge with master 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
« no previous file with comments | « extensions/browser/api/cast_channel/cast_channel_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b3d76cbafa30637c378cadaf562980089c62258c..a93e7b5467369dc26fd6fd1769a830709c9b7d10 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.
@@ -224,7 +224,7 @@ ACTION_P2(InvokeObserverOnError, api_test, cast_socket_service) {
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&CastChannelAPITest::DoCallOnError, base::Unretained(api_test),
- base::RetainedRef(cast_socket_service)));
+ base::Unretained(cast_socket_service)));
}
// TODO(kmarshall): Win Dbg has a workaround that makes RunExtensionSubtest
« no previous file with comments | « extensions/browser/api/cast_channel/cast_channel_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698