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

Side by Side Diff: services/ui/public/cpp/tests/window_server_shelltest_base.cc

Issue 2435153004: Change Service contract to pass ServiceInfo instead of Identity (Closed)
Patch Set: . Created 4 years, 1 month 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/ui/ime/test_ime_driver/test_ime_application.cc ('k') | services/ui/service.h » ('j') | 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/ui/public/cpp/tests/window_server_shelltest_base.h" 5 #include "services/ui/public/cpp/tests/window_server_shelltest_base.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 11 matching lines...) Expand all
22 22
23 class WindowServerServiceTestClient 23 class WindowServerServiceTestClient
24 : public service_manager::test::ServiceTestClient { 24 : public service_manager::test::ServiceTestClient {
25 public: 25 public:
26 explicit WindowServerServiceTestClient(WindowServerServiceTestBase* test) 26 explicit WindowServerServiceTestClient(WindowServerServiceTestBase* test)
27 : ServiceTestClient(test), test_(test) {} 27 : ServiceTestClient(test), test_(test) {}
28 ~WindowServerServiceTestClient() override {} 28 ~WindowServerServiceTestClient() override {}
29 29
30 private: 30 private:
31 // service_manager::test::ServiceTestClient: 31 // service_manager::test::ServiceTestClient:
32 bool OnConnect(const service_manager::Identity& remote_identity, 32 bool OnConnect(const service_manager::ServiceInfo& remote_info,
33 service_manager::InterfaceRegistry* registry) override { 33 service_manager::InterfaceRegistry* registry) override {
34 return test_->OnConnect(remote_identity, registry); 34 return test_->OnConnect(remote_info.identity, registry);
35 } 35 }
36 36
37 WindowServerServiceTestBase* test_; 37 WindowServerServiceTestBase* test_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(WindowServerServiceTestClient); 39 DISALLOW_COPY_AND_ASSIGN(WindowServerServiceTestClient);
40 }; 40 };
41 41
42 void EnsureCommandLineSwitch(const std::string& name) { 42 void EnsureCommandLineSwitch(const std::string& name) {
43 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 43 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
44 if (!cmd_line->HasSwitch(name)) 44 if (!cmd_line->HasSwitch(name))
45 cmd_line->AppendSwitch(name); 45 cmd_line->AppendSwitch(name);
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
50 WindowServerServiceTestBase::WindowServerServiceTestBase() 50 WindowServerServiceTestBase::WindowServerServiceTestBase()
51 : ServiceTest(kTestAppName) { 51 : ServiceTest(kTestAppName) {
52 EnsureCommandLineSwitch(switches::kUseTestConfig); 52 EnsureCommandLineSwitch(switches::kUseTestConfig);
53 EnsureCommandLineSwitch(::switches::kOverrideUseGLWithOSMesaForTests); 53 EnsureCommandLineSwitch(::switches::kOverrideUseGLWithOSMesaForTests);
54 } 54 }
55 55
56 WindowServerServiceTestBase::~WindowServerServiceTestBase() {} 56 WindowServerServiceTestBase::~WindowServerServiceTestBase() {}
57 57
58 std::unique_ptr<service_manager::Service> 58 std::unique_ptr<service_manager::Service>
59 WindowServerServiceTestBase::CreateService() { 59 WindowServerServiceTestBase::CreateService() {
60 return base::MakeUnique<WindowServerServiceTestClient>(this); 60 return base::MakeUnique<WindowServerServiceTestClient>(this);
61 } 61 }
62 62
63 } // namespace ui 63 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ime/test_ime_driver/test_ime_application.cc ('k') | services/ui/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698