Index: mojo/shell/shell_test_helper.cc |
diff --git a/mojo/shell/shell_test_helper.cc b/mojo/shell/shell_test_helper.cc |
index a33810d9dd461ec728d88143044aeb11d7f6dea3..a198e155e9676f88254a9cdb6e91a4a268f53213 100644 |
--- a/mojo/shell/shell_test_helper.cc |
+++ b/mojo/shell/shell_test_helper.cc |
@@ -19,7 +19,7 @@ namespace shell { |
struct ShellTestHelper::State { |
scoped_ptr<Context> context; |
scoped_ptr<ServiceManager::TestAPI> test_api; |
- ScopedMessagePipeHandle shell_handle; |
+ ScopedMessagePipeHandle service_provider_handle; |
}; |
namespace { |
@@ -28,28 +28,28 @@ void StartShellOnShellThread(ShellTestHelper::State* state) { |
state->context.reset(new Context); |
state->test_api.reset( |
new ServiceManager::TestAPI(state->context->service_manager())); |
- state->shell_handle = state->test_api->GetShellHandle(); |
+ state->service_provider_handle = state->test_api->GetServiceProviderHandle(); |
} |
} // namespace |
-class ShellTestHelper::TestShellClient : public ShellClient { |
+class ShellTestHelper::TestServiceProvider : public ServiceProvider { |
public: |
- TestShellClient() {} |
- virtual ~TestShellClient() {} |
+ TestServiceProvider() {} |
+ virtual ~TestServiceProvider() {} |
- // ShellClient: |
- virtual void AcceptConnection( |
+ // ServiceProvider: |
+ virtual void ConnectToService( |
const mojo::String& url, |
ScopedMessagePipeHandle client_handle) OVERRIDE { |
} |
private: |
- DISALLOW_COPY_AND_ASSIGN(TestShellClient); |
+ DISALLOW_COPY_AND_ASSIGN(TestServiceProvider); |
}; |
ShellTestHelper::ShellTestHelper() |
- : shell_thread_("shell_test_helper"), |
+ : service_provider_thread_("shell_test_helper"), |
state_(NULL) { |
base::CommandLine::Init(0, NULL); |
mojo::shell::InitializeLogging(); |
@@ -59,7 +59,7 @@ ShellTestHelper::~ShellTestHelper() { |
if (state_) { |
// |state_| contains data created on the background thread. Destroy it |
// there so that there aren't any race conditions. |
- shell_thread_.message_loop()->DeleteSoon(FROM_HERE, state_); |
+ service_provider_thread_.message_loop()->DeleteSoon(FROM_HERE, state_); |
state_ = NULL; |
} |
} |
@@ -67,20 +67,23 @@ ShellTestHelper::~ShellTestHelper() { |
void ShellTestHelper::Init() { |
DCHECK(!state_); |
state_ = new State; |
- shell_thread_.Start(); |
- shell_thread_.message_loop()->message_loop_proxy()->PostTaskAndReply( |
+ service_provider_thread_.Start(); |
+ base::MessageLoopProxy* message_loop_proxy = |
+ service_provider_thread_.message_loop()->message_loop_proxy(); |
+ message_loop_proxy->PostTaskAndReply( |
FROM_HERE, |
base::Bind(&StartShellOnShellThread, state_), |
- base::Bind(&ShellTestHelper::OnShellStarted, base::Unretained(this))); |
+ base::Bind(&ShellTestHelper::OnServiceProviderStarted, |
+ base::Unretained(this))); |
run_loop_.reset(new base::RunLoop); |
run_loop_->Run(); |
} |
-void ShellTestHelper::OnShellStarted() { |
+void ShellTestHelper::OnServiceProviderStarted() { |
DCHECK(state_); |
- shell_client_.reset(new TestShellClient); |
- shell_.Bind(state_->shell_handle.Pass()); |
- shell_.set_client(shell_client_.get()); |
+ local_service_provider_.reset(new TestServiceProvider); |
+ service_provider_.Bind(state_->service_provider_handle.Pass()); |
+ service_provider_.set_client(local_service_provider_.get()); |
run_loop_->Quit(); |
} |