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

Side by Side Diff: services/shell/public/cpp/lib/shell_test.cc

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/shell/public/cpp/shell_test.h" 5 #include "services/shell/public/cpp/shell_test.h"
6 6
7 #include "base/memory/ptr_util.h"
7 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 9 #include "base/run_loop.h"
9 #include "services/shell/background/background_shell.h" 10 #include "services/shell/background/background_shell.h"
10 #include "services/shell/public/cpp/shell_client.h" 11 #include "services/shell/public/cpp/shell_client.h"
11 12
12 namespace mojo { 13 namespace shell {
13 namespace test { 14 namespace test {
14 15
15 ShellTestClient::ShellTestClient(ShellTest* test) : test_(test) {} 16 ShellTestClient::ShellTestClient(ShellTest* test) : test_(test) {}
16 ShellTestClient::~ShellTestClient() {} 17 ShellTestClient::~ShellTestClient() {}
17 18
18 void ShellTestClient::Initialize(Connector* connector, const Identity& identity, 19 void ShellTestClient::Initialize(Connector* connector, const Identity& identity,
19 uint32_t id) { 20 uint32_t id) {
20 test_->InitializeCalled(connector, identity.name(), identity.user_id(), id); 21 test_->InitializeCalled(connector, identity.name(), identity.user_id(), id);
21 } 22 }
22 23
23 ShellTest::ShellTest() {} 24 ShellTest::ShellTest() {}
24 ShellTest::ShellTest(const std::string& test_name) : test_name_(test_name) {} 25 ShellTest::ShellTest(const std::string& test_name) : test_name_(test_name) {}
25 ShellTest::~ShellTest() {} 26 ShellTest::~ShellTest() {}
26 27
27 void ShellTest::InitTestName(const std::string& test_name) { 28 void ShellTest::InitTestName(const std::string& test_name) {
28 DCHECK(test_name_.empty()); 29 DCHECK(test_name_.empty());
29 test_name_ = test_name; 30 test_name_ = test_name;
30 } 31 }
31 32
32 scoped_ptr<ShellClient> ShellTest::CreateShellClient() { 33 std::unique_ptr<ShellClient> ShellTest::CreateShellClient() {
33 return make_scoped_ptr(new ShellTestClient(this)); 34 return base::WrapUnique(new ShellTestClient(this));
34 } 35 }
35 36
36 scoped_ptr<base::MessageLoop> ShellTest::CreateMessageLoop() { 37 std::unique_ptr<base::MessageLoop> ShellTest::CreateMessageLoop() {
37 return make_scoped_ptr(new base::MessageLoop); 38 return base::WrapUnique(new base::MessageLoop);
38 } 39 }
39 40
40 void ShellTest::InitializeCalled(Connector* connector, 41 void ShellTest::InitializeCalled(Connector* connector,
41 const std::string& name, 42 const std::string& name,
42 const std::string& user_id, 43 const std::string& user_id,
43 uint32_t id) { 44 uint32_t id) {
44 DCHECK_EQ(connector_, connector); 45 DCHECK_EQ(connector_, connector);
45 initialize_name_ = name; 46 initialize_name_ = name;
46 initialize_instance_id_ = id; 47 initialize_instance_id_ = id;
47 initialize_userid_ = user_id; 48 initialize_userid_ = user_id;
(...skipping 22 matching lines...) Expand all
70 } 71 }
71 72
72 void ShellTest::TearDown() { 73 void ShellTest::TearDown() {
73 shell_connection_.reset(); 74 shell_connection_.reset();
74 background_shell_.reset(); 75 background_shell_.reset();
75 message_loop_.reset(); 76 message_loop_.reset();
76 shell_client_.reset(); 77 shell_client_.reset();
77 } 78 }
78 79
79 } // namespace test 80 } // namespace test
80 } // namespace mojo 81 } // namespace shell
OLDNEW
« no previous file with comments | « services/shell/public/cpp/lib/shell_connection.cc ('k') | services/shell/public/cpp/message_loop_ref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698