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

Side by Side Diff: services/service_manager/public/cpp/lib/service_test.cc

Issue 2812223006: Replace device_sensor browsertest by service unittest. (Closed)
Patch Set: eliminate "unreachable code" warning. Created 3 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
« no previous file with comments | « services/device/unittest_manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/service_manager/public/cpp/service_test.h" 5 #include "services/service_manager/public/cpp/service_test.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void ServiceTest::InitTestName(const std::string& test_name) { 42 void ServiceTest::InitTestName(const std::string& test_name) {
43 DCHECK(test_name_.empty()); 43 DCHECK(test_name_.empty());
44 test_name_ = test_name; 44 test_name_ = test_name;
45 } 45 }
46 46
47 std::unique_ptr<Service> ServiceTest::CreateService() { 47 std::unique_ptr<Service> ServiceTest::CreateService() {
48 return base::MakeUnique<ServiceTestClient>(this); 48 return base::MakeUnique<ServiceTestClient>(this);
49 } 49 }
50 50
51 std::unique_ptr<base::MessageLoop> ServiceTest::CreateMessageLoop() { 51 std::unique_ptr<base::MessageLoop> ServiceTest::CreateMessageLoop() {
52 return base::MakeUnique<base::MessageLoop>(); 52 return base::MakeUnique<base::MessageLoop>(base::MessageLoop::TYPE_UI);
53 } 53 }
54 54
55 void ServiceTest::OnStartCalled(Connector* connector, 55 void ServiceTest::OnStartCalled(Connector* connector,
56 const std::string& name, 56 const std::string& name,
57 const std::string& user_id) { 57 const std::string& user_id) {
58 DCHECK_EQ(connector_, connector); 58 DCHECK_EQ(connector_, connector);
59 initialize_name_ = name; 59 initialize_name_ = name;
60 initialize_userid_ = user_id; 60 initialize_userid_ = user_id;
61 initialize_called_.Run(); 61 initialize_called_.Run();
62 } 62 }
(...skipping 24 matching lines...) Expand all
87 } 87 }
88 88
89 void ServiceTest::TearDown() { 89 void ServiceTest::TearDown() {
90 background_service_manager_.reset(); 90 background_service_manager_.reset();
91 context_.reset(); 91 context_.reset();
92 message_loop_.reset(); 92 message_loop_.reset();
93 } 93 }
94 94
95 } // namespace test 95 } // namespace test
96 } // namespace service_manager 96 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/device/unittest_manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698