Index: mojo/shell/public/cpp/lib/shell_test.cc |
diff --git a/mojo/shell/public/cpp/lib/shell_test.cc b/mojo/shell/public/cpp/lib/shell_test.cc |
deleted file mode 100644 |
index 605e7c59b1b3f2b951e8bf719f2d4cb0dc76b0f1..0000000000000000000000000000000000000000 |
--- a/mojo/shell/public/cpp/lib/shell_test.cc |
+++ /dev/null |
@@ -1,80 +0,0 @@ |
-// Copyright 2016 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-#include "mojo/shell/public/cpp/shell_test.h" |
- |
-#include "base/message_loop/message_loop.h" |
-#include "base/run_loop.h" |
-#include "mojo/shell/background/background_shell.h" |
-#include "mojo/shell/public/cpp/shell_client.h" |
- |
-namespace mojo { |
-namespace test { |
- |
-ShellTestClient::ShellTestClient(ShellTest* test) : test_(test) {} |
-ShellTestClient::~ShellTestClient() {} |
- |
-void ShellTestClient::Initialize(Connector* connector, const Identity& identity, |
- uint32_t id) { |
- test_->InitializeCalled(connector, identity.name(), identity.user_id(), id); |
-} |
- |
-ShellTest::ShellTest() {} |
-ShellTest::ShellTest(const std::string& test_name) : test_name_(test_name) {} |
-ShellTest::~ShellTest() {} |
- |
-void ShellTest::InitTestName(const std::string& test_name) { |
- DCHECK(test_name_.empty()); |
- test_name_ = test_name; |
-} |
- |
-scoped_ptr<ShellClient> ShellTest::CreateShellClient() { |
- return make_scoped_ptr(new ShellTestClient(this)); |
-} |
- |
-scoped_ptr<base::MessageLoop> ShellTest::CreateMessageLoop() { |
- return make_scoped_ptr(new base::MessageLoop); |
-} |
- |
-void ShellTest::InitializeCalled(Connector* connector, |
- const std::string& name, |
- const std::string& user_id, |
- uint32_t id) { |
- DCHECK_EQ(connector_, connector); |
- initialize_name_ = name; |
- initialize_instance_id_ = id; |
- initialize_userid_ = user_id; |
- initialize_called_.Run(); |
-} |
- |
-void ShellTest::SetUp() { |
- shell_client_ = CreateShellClient(); |
- message_loop_ = CreateMessageLoop(); |
- background_shell_.reset(new shell::BackgroundShell); |
- background_shell_->Init(nullptr); |
- |
- // Create the shell connection. We don't proceed until we get our |
- // ShellClient's Initialize() method is called. |
- base::RunLoop run_loop; |
- base::MessageLoop::ScopedNestableTaskAllower allow( |
- base::MessageLoop::current()); |
- initialize_called_ = run_loop.QuitClosure(); |
- |
- shell_connection_.reset(new ShellConnection( |
- shell_client_.get(), |
- background_shell_->CreateShellClientRequest(test_name_))); |
- connector_ = shell_connection_->connector(); |
- |
- run_loop.Run(); |
-} |
- |
-void ShellTest::TearDown() { |
- shell_connection_.reset(); |
- background_shell_.reset(); |
- message_loop_.reset(); |
- shell_client_.reset(); |
-} |
- |
-} // namespace test |
-} // namespace mojo |