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

Unified Diff: services/shell/public/cpp/lib/service_test.cc

Issue 2179023004: Make Service own ServiceContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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 | « services/shell/public/cpp/lib/service_runner.cc ('k') | services/shell/public/cpp/service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/public/cpp/lib/service_test.cc
diff --git a/services/shell/public/cpp/lib/service_test.cc b/services/shell/public/cpp/lib/service_test.cc
index 30176a18c540779308bdf9135af2a37c149e68c0..447e8dd94280872a494c2aacf2dfed764bcd653f 100644
--- a/services/shell/public/cpp/lib/service_test.cc
+++ b/services/shell/public/cpp/lib/service_test.cc
@@ -16,9 +16,9 @@ namespace test {
ServiceTestClient::ServiceTestClient(ServiceTest* test) : test_(test) {}
ServiceTestClient::~ServiceTestClient() {}
-void ServiceTestClient::OnStart(Connector* connector, const Identity& identity,
- uint32_t id) {
- test_->OnStartCalled(connector, identity.name(), identity.user_id(), id);
+void ServiceTestClient::OnStart(const Identity& identity) {
+ test_->OnStartCalled(connector(), identity.name(),
+ identity.user_id());
}
ServiceTest::ServiceTest() {}
@@ -40,12 +40,10 @@ std::unique_ptr<base::MessageLoop> ServiceTest::CreateMessageLoop() {
}
void ServiceTest::OnStartCalled(Connector* connector,
- const std::string& name,
- const std::string& user_id,
- uint32_t id) {
+ const std::string& name,
+ const std::string& user_id) {
DCHECK_EQ(connector_, connector);
initialize_name_ = name;
- initialize_instance_id_ = id;
initialize_userid_ = user_id;
initialize_called_.Run();
}
@@ -63,16 +61,15 @@ void ServiceTest::SetUp() {
base::MessageLoop::current());
initialize_called_ = run_loop.QuitClosure();
- service_context_.reset(new ServiceContext(
+ service_->set_context(base::WrapUnique(new ServiceContext(
service_.get(),
- background_shell_->CreateServiceRequest(test_name_)));
- connector_ = service_context_->connector();
+ background_shell_->CreateServiceRequest(test_name_))));
+ connector_ = service_->connector();
run_loop.Run();
}
void ServiceTest::TearDown() {
- service_context_.reset();
background_shell_.reset();
message_loop_.reset();
service_.reset();
« no previous file with comments | « services/shell/public/cpp/lib/service_runner.cc ('k') | services/shell/public/cpp/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698