| Index: ui/views/mus/views_aura_mus_test_suite.cc
|
| diff --git a/ui/views/mus/views_mus_test_suite.cc b/ui/views/mus/views_aura_mus_test_suite.cc
|
| similarity index 89%
|
| copy from ui/views/mus/views_mus_test_suite.cc
|
| copy to ui/views/mus/views_aura_mus_test_suite.cc
|
| index a08b1e2ae1dc90d0ceb0c87d831ff81c48d62188..2a8381223c9f8a65d477990510e274bda6337be1 100644
|
| --- a/ui/views/mus/views_mus_test_suite.cc
|
| +++ b/ui/views/mus/views_aura_mus_test_suite.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ui/views/mus/views_mus_test_suite.h"
|
| +#include "ui/views/mus/views_aura_mus_test_suite.h"
|
|
|
| #include <memory>
|
| #include <string>
|
| @@ -19,8 +19,10 @@
|
| #include "services/service_manager/public/cpp/service_context.h"
|
| #include "services/ui/common/switches.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| -#include "ui/views/mus/window_manager_connection.h"
|
| +#include "ui/views/mus/mus_client.h"
|
| +#include "ui/views/mus/test_utils.h"
|
| #include "ui/views/test/platform_test_helper.h"
|
| +#include "ui/views/test/views_test_helper_aura.h"
|
| #include "ui/views/views_delegate.h"
|
|
|
| namespace views {
|
| @@ -45,14 +47,20 @@ class PlatformTestHelperMus : public PlatformTestHelper {
|
| public:
|
| PlatformTestHelperMus(service_manager::Connector* connector,
|
| const service_manager::Identity& identity) {
|
| - // It is necessary to recreate the WindowManagerConnection for each test,
|
| + // It is necessary to recreate the MusClient for each test,
|
| // since a new MessageLoop is created for each test.
|
| - connection_ = WindowManagerConnection::Create(connector, identity);
|
| + mus_client_ = test::MusClientTestApi::Create(connector, identity);
|
| }
|
| ~PlatformTestHelperMus() override {}
|
|
|
| + // PlatformTestHelper:
|
| + void OnTestHelperCreated(ViewsTestHelper* helper) override {
|
| + static_cast<ViewsTestHelperAura*>(helper)->EnableMusWithWindowTreeClient(
|
| + mus_client_->window_tree_client());
|
| + }
|
| +
|
| private:
|
| - std::unique_ptr<WindowManagerConnection> connection_;
|
| + std::unique_ptr<MusClient> mus_client_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(PlatformTestHelperMus);
|
| };
|
| @@ -161,12 +169,12 @@ class ServiceManagerConnection {
|
| DISALLOW_COPY_AND_ASSIGN(ServiceManagerConnection);
|
| };
|
|
|
| -ViewsMusTestSuite::ViewsMusTestSuite(int argc, char** argv)
|
| +ViewsAuraMusTestSuite::ViewsAuraMusTestSuite(int argc, char** argv)
|
| : ViewsTestSuite(argc, argv) {}
|
|
|
| -ViewsMusTestSuite::~ViewsMusTestSuite() {}
|
| +ViewsAuraMusTestSuite::~ViewsAuraMusTestSuite() {}
|
|
|
| -void ViewsMusTestSuite::Initialize() {
|
| +void ViewsAuraMusTestSuite::Initialize() {
|
| PlatformTestHelper::SetIsMus();
|
| // Let other services know that we're running in tests. Do this with a
|
| // command line flag to avoid making blocking calls to other processes for
|
| @@ -177,7 +185,7 @@ void ViewsMusTestSuite::Initialize() {
|
| service_manager_connections_ = base::MakeUnique<ServiceManagerConnection>();
|
| }
|
|
|
| -void ViewsMusTestSuite::Shutdown() {
|
| +void ViewsAuraMusTestSuite::Shutdown() {
|
| service_manager_connections_.reset();
|
| ViewsTestSuite::Shutdown();
|
| }
|
|
|