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

Side by Side Diff: ui/views/mus/platform_test_helper_mus.cc

Issue 1725353003: Eliminate mojo::Shell client lib class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@15connector
Patch Set: . Created 4 years, 9 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 | « ui/views/mus/native_widget_mus.cc ('k') | ui/views/mus/platform_window_mus.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 "ui/views/test/platform_test_helper.h" 5 #include "ui/views/test/platform_test_helper.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "mojo/shell/background/background_shell.h" 8 #include "mojo/shell/background/background_shell.h"
9 #include "mojo/shell/background/tests/test_application_catalog_store.h" 9 #include "mojo/shell/background/tests/test_application_catalog_store.h"
10 #include "mojo/shell/public/cpp/connector.h"
10 #include "mojo/shell/public/cpp/shell_client.h" 11 #include "mojo/shell/public/cpp/shell_client.h"
11 #include "mojo/shell/public/cpp/shell_connection.h" 12 #include "mojo/shell/public/cpp/shell_connection.h"
12 #include "ui/views/mus/window_manager_connection.h" 13 #include "ui/views/mus/window_manager_connection.h"
13 #include "url/gurl.h" 14 #include "url/gurl.h"
14 15
15 using mojo::shell::BackgroundShell; 16 using mojo::shell::BackgroundShell;
16 17
17 namespace views { 18 namespace views {
18 namespace { 19 namespace {
19 20
(...skipping 25 matching lines...) Expand all
45 new BackgroundShell::InitParams); 46 new BackgroundShell::InitParams);
46 init_params->app_catalog = BuildTestApplicationCatalogStore(); 47 init_params->app_catalog = BuildTestApplicationCatalogStore();
47 background_shell_->Init(std::move(init_params)); 48 background_shell_->Init(std::move(init_params));
48 shell_client_.reset(new DefaultShellClient); 49 shell_client_.reset(new DefaultShellClient);
49 shell_connection_.reset(new mojo::ShellConnection( 50 shell_connection_.reset(new mojo::ShellConnection(
50 shell_client_.get(), 51 shell_client_.get(),
51 background_shell_->CreateShellClientRequest(GURL(kTestUrl)))); 52 background_shell_->CreateShellClientRequest(GURL(kTestUrl))));
52 shell_connection_->WaitForInitialize(); 53 shell_connection_->WaitForInitialize();
53 // ui/views/mus requires a WindowManager running, for now use the desktop 54 // ui/views/mus requires a WindowManager running, for now use the desktop
54 // one. 55 // one.
55 mojo::Shell* shell = shell_connection_.get(); 56 mojo::Connector* connector = shell_connection_->connector();
56 shell->Connect("mojo:desktop_wm"); 57 connector->Connect("mojo:desktop_wm");
57 WindowManagerConnection::Create(shell_connection_.get()); 58 WindowManagerConnection::Create(connector);
58 } 59 }
59 60
60 ~PlatformTestHelperMus() override { 61 ~PlatformTestHelperMus() override {
61 WindowManagerConnection::Reset(); 62 WindowManagerConnection::Reset();
62 // |app_| has a reference to us, destroy it while we are still valid. 63 // |app_| has a reference to us, destroy it while we are still valid.
63 shell_connection_.reset(); 64 shell_connection_.reset();
64 } 65 }
65 66
66 private: 67 private:
67 scoped_ptr<BackgroundShell> background_shell_; 68 scoped_ptr<BackgroundShell> background_shell_;
68 scoped_ptr<mojo::ShellConnection> shell_connection_; 69 scoped_ptr<mojo::ShellConnection> shell_connection_;
69 scoped_ptr<DefaultShellClient> shell_client_; 70 scoped_ptr<DefaultShellClient> shell_client_;
70 71
71 DISALLOW_COPY_AND_ASSIGN(PlatformTestHelperMus); 72 DISALLOW_COPY_AND_ASSIGN(PlatformTestHelperMus);
72 }; 73 };
73 74
74 } // namespace 75 } // namespace
75 76
76 // static 77 // static
77 scoped_ptr<PlatformTestHelper> PlatformTestHelper::Create() { 78 scoped_ptr<PlatformTestHelper> PlatformTestHelper::Create() {
78 return make_scoped_ptr(new PlatformTestHelperMus); 79 return make_scoped_ptr(new PlatformTestHelperMus);
79 } 80 }
80 81
81 } // namespace views 82 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/native_widget_mus.cc ('k') | ui/views/mus/platform_window_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698