Commit 8f417bb7 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

aura: adds AuraTestSuiteSetup to configure Env and mus

The current pattern for test suites that *may* use aura has the test
suite create aura::Env. In order to enable mus more broadly we need to
make it so that the test suite configures Env appropriate for mus.

This patch adds AuraTestSuiteSetup that is meant to setup the
necessary state at the test suite level for tests that may use
aura. It looks at the command line and potentially enables mus as
appropriate.

In order to setup env for mus WindowTreeClient needs to be configured,
which required moving around some stubs. I had to update
AuraTestHelper for mus being configured at the global level. This
is mildly complicated by the fact that AuraTestHelper wants to create
its own WindowTreeClient in this case.

BUG=776514
TEST=covered by tests

Change-Id: Ie433e4f6afe58b2aa15bdfb08fe462c6c1a30fad
Reviewed-on: https://chromium-review.googlesource.com/792455
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarElliot Glaysher <erg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519884}
parent 72d61b42
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <map>
#include <memory>
#include <vector>
#include "ash/mus/window_manager.h"
#include "ash/mus/window_manager_service.h"
#include "ash/public/cpp/window_properties.h"
#include "ash/public/interfaces/constants.mojom.h"
#include "ash/public/interfaces/window_properties.mojom.h"
#include "ash/session/test_session_controller_client.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/ash_test_helper.h"
#include "base/bind.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "components/session_manager/session_manager_types.h"
#include "services/service_manager/public/cpp/service_test.h"
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/interfaces/window_manager_constants.mojom.h"
#include "services/ui/public/interfaces/window_tree.mojom.h"
#include "ui/aura/env.h"
#include "ui/aura/mus/property_converter.h"
#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/mus/window_tree_client_delegate.h"
#include "ui/aura/mus/window_tree_host_mus.h"
#include "ui/aura/mus/window_tree_host_mus_init_params.h"
#include "ui/aura/test/env_test_helper.h"
#include "ui/aura/window.h"
#include "ui/display/display.h"
#include "ui/display/display_list.h"
#include "ui/display/screen_base.h"
#include "ui/wm/core/capture_controller.h"
#include "ui/wm/core/wm_state.h"
namespace ash {
class WindowTreeClientDelegate : public aura::WindowTreeClientDelegate {
public:
WindowTreeClientDelegate() {}
~WindowTreeClientDelegate() override {}
void WaitForEmbed() { run_loop_.Run(); }
void DestroyWindowTreeHost() { window_tree_host_.reset(); }
private:
// aura::WindowTreeClientDelegate:
void OnEmbed(
std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override {
window_tree_host_ = std::move(window_tree_host);
run_loop_.Quit();
}
void OnEmbedRootDestroyed(
aura::WindowTreeHostMus* window_tree_host) override {}
void OnLostConnection(aura::WindowTreeClient* client) override {}
void OnPointerEventObserved(const ui::PointerEvent& event,
aura::Window* target) override {}
aura::PropertyConverter* GetPropertyConverter() override {
return &property_converter_;
}
base::RunLoop run_loop_;
::wm::WMState wm_state_;
aura::PropertyConverter property_converter_;
std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_;
DISALLOW_COPY_AND_ASSIGN(WindowTreeClientDelegate);
};
class WindowManagerServiceTest : public service_manager::test::ServiceTest {
public:
WindowManagerServiceTest()
: service_manager::test::ServiceTest("mash_unittests") {}
~WindowManagerServiceTest() override {}
void TearDown() override {
// Unset the screen installed by the test.
display::Screen::SetScreenInstance(nullptr);
service_manager::test::ServiceTest::TearDown();
}
private:
DISALLOW_COPY_AND_ASSIGN(WindowManagerServiceTest);
};
void OnEmbed(bool success) {
ASSERT_TRUE(success);
}
TEST_F(WindowManagerServiceTest, OpenWindow) {
display::ScreenBase screen;
screen.display_list().AddDisplay(
display::Display(1, gfx::Rect(0, 0, 200, 200)),
display::DisplayList::Type::PRIMARY);
display::Screen::SetScreenInstance(&screen);
WindowTreeClientDelegate window_tree_delegate;
connector()->StartService(mojom::kServiceName);
// Connect to mus and create a new top level window. The request goes to
// |ash|, but is async.
aura::WindowTreeClient client(connector(), &window_tree_delegate, nullptr,
nullptr, nullptr, false);
client.ConnectViaWindowTreeFactory();
aura::test::EnvWindowTreeClientSetter env_window_tree_client_setter(&client);
std::map<std::string, std::vector<uint8_t>> properties;
properties[ui::mojom::WindowManager::kWindowType_InitProperty] =
mojo::ConvertTo<std::vector<uint8_t>>(
static_cast<int32_t>(ui::mojom::WindowType::WINDOW));
aura::WindowTreeHostMus window_tree_host_mus(
aura::CreateInitParamsForTopLevel(&client, std::move(properties)));
window_tree_host_mus.InitHost();
aura::Window* child_window = new aura::Window(nullptr);
child_window->Init(ui::LAYER_NOT_DRAWN);
window_tree_host_mus.window()->AddChild(child_window);
// Create another WindowTreeClient by way of embedding in
// |child_window|. This blocks until it succeeds.
ui::mojom::WindowTreeClientPtr tree_client;
auto tree_client_request = MakeRequest(&tree_client);
client.Embed(child_window, std::move(tree_client), 0u, base::Bind(&OnEmbed));
aura::WindowTreeClient child_client(connector(), &window_tree_delegate,
nullptr, std::move(tree_client_request),
nullptr, false);
window_tree_delegate.WaitForEmbed();
ASSERT_TRUE(!child_client.GetRoots().empty());
window_tree_delegate.DestroyWindowTreeHost();
}
using WindowManagerTest = AshTestBase;
TEST_F(WindowManagerTest, SystemModalLockIsntReparented) {
ash_test_helper()->test_session_controller_client()->SetSessionState(
session_manager::SessionState::LOCKED);
std::unique_ptr<aura::Window> window = CreateTestWindow();
aura::Window* system_modal_container = Shell::GetContainer(
Shell::GetPrimaryRootWindow(), kShellWindowId_LockSystemModalContainer);
system_modal_container->AddChild(window.get());
aura::WindowManagerDelegate* window_manager_delegate =
ash_test_helper()->window_manager_service()->window_manager();
window_manager_delegate->OnWmSetModalType(window.get(),
ui::MODAL_TYPE_SYSTEM);
ASSERT_TRUE(window->parent());
// Setting to system modal should not reparent.
EXPECT_EQ(kShellWindowId_LockSystemModalContainer, window->parent()->id());
}
TEST_F(WindowManagerTest, CanConsumeSystemKeysFromContentBrowser) {
std::map<std::string, std::vector<uint8_t>> properties;
properties[ash::mojom::kCanConsumeSystemKeys_Property] =
mojo::ConvertTo<std::vector<uint8_t>>(static_cast<int64_t>(true));
aura::WindowManagerDelegate* window_manager_delegate =
ash_test_helper()->window_manager_service()->window_manager();
aura::Window* window = window_manager_delegate->OnWmCreateTopLevelWindow(
ui::mojom::WindowType::WINDOW, &properties);
EXPECT_EQ(true, window->GetProperty(kCanConsumeSystemKeysKey));
}
} // namespace ash
...@@ -95,7 +95,9 @@ void AshTestHelper::SetUp(bool start_session, bool provide_local_state) { ...@@ -95,7 +95,9 @@ void AshTestHelper::SetUp(bool start_session, bool provide_local_state) {
switches::kAshDisableSmoothScreenRotation); switches::kAshDisableSmoothScreenRotation);
} }
if (config_ == Config::MUS) // Allow for other code to have created InputDeviceManager (such as the
// test-suite).
if (config_ == Config::MUS && !ui::InputDeviceManager::HasInstance())
input_device_client_ = std::make_unique<ui::InputDeviceClient>(); input_device_client_ = std::make_unique<ui::InputDeviceClient>();
display::ResetDisplayIdForTest(); display::ResetDisplayIdForTest();
...@@ -231,6 +233,7 @@ void AshTestHelper::TearDown() { ...@@ -231,6 +233,7 @@ void AshTestHelper::TearDown() {
command_line_.reset(); command_line_.reset();
display::Display::ResetForceDeviceScaleFactorForTesting(); display::Display::ResetForceDeviceScaleFactorForTesting();
env_window_tree_client_setter_.reset();
// WindowManager owns the CaptureController for mus/mash. // WindowManager owns the CaptureController for mus/mash.
CHECK(config_ != Config::CLASSIC || !::wm::CaptureController::Get()); CHECK(config_ != Config::CLASSIC || !::wm::CaptureController::Get());
...@@ -267,8 +270,9 @@ void AshTestHelper::CreateMashWindowManager() { ...@@ -267,8 +270,9 @@ void AshTestHelper::CreateMashWindowManager() {
window_tree_client_setup_.InitForWindowManager( window_tree_client_setup_.InitForWindowManager(
window_manager_service_->window_manager_.get(), window_manager_service_->window_manager_.get(),
window_manager_service_->window_manager_.get()); window_manager_service_->window_manager_.get());
aura::test::EnvTestHelper().SetWindowTreeClient( env_window_tree_client_setter_ =
window_tree_client_setup_.window_tree_client()); std::make_unique<aura::test::EnvWindowTreeClientSetter>(
window_tree_client_setup_.window_tree_client());
// Classic ash does not start the NetworkHandler in tests, so don't start it // Classic ash does not start the NetworkHandler in tests, so don't start it
// for mash either. The NetworkHandler may cause subtle side effects (such as // for mash either. The NetworkHandler may cause subtle side effects (such as
// additional tray items) that can make for flaky tests. // additional tray items) that can make for flaky tests.
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
namespace aura { namespace aura {
class Window; class Window;
class WindowTreeClientPrivate; class WindowTreeClientPrivate;
namespace test {
class EnvWindowTreeClientSetter;
}
} }
namespace display { namespace display {
...@@ -129,6 +132,8 @@ class AshTestHelper { ...@@ -129,6 +132,8 @@ class AshTestHelper {
static Config config_; static Config config_;
std::unique_ptr<aura::test::EnvWindowTreeClientSetter>
env_window_tree_client_setter_;
AshTestEnvironment* ash_test_environment_; // Not owned. AshTestEnvironment* ash_test_environment_; // Not owned.
TestShellDelegate* test_shell_delegate_; // Owned by ash::Shell. TestShellDelegate* test_shell_delegate_; // Owned by ash::Shell.
std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
......
...@@ -108,7 +108,7 @@ TEST_F(WindowManagerServiceTest, OpenWindow) { ...@@ -108,7 +108,7 @@ TEST_F(WindowManagerServiceTest, OpenWindow) {
aura::WindowTreeClient client(connector(), &window_tree_delegate, nullptr, aura::WindowTreeClient client(connector(), &window_tree_delegate, nullptr,
nullptr, nullptr, false); nullptr, nullptr, false);
client.ConnectViaWindowTreeFactory(); client.ConnectViaWindowTreeFactory();
aura::test::EnvTestHelper().SetWindowTreeClient(&client); aura::test::EnvWindowTreeClientSetter env_window_tree_client_setter(&client);
std::map<std::string, std::vector<uint8_t>> properties; std::map<std::string, std::vector<uint8_t>> properties;
properties[ui::mojom::WindowManager::kWindowType_InitProperty] = properties[ui::mojom::WindowManager::kWindowType_InitProperty] =
mojo::ConvertTo<std::vector<uint8_t>>( mojo::ConvertTo<std::vector<uint8_t>>(
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "content/public/test/unittest_test_suite.h" #include "content/public/test/unittest_test_suite.h"
#include "base/command_line.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/test/test_suite.h" #include "base/test/test_suite.h"
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
#include "third_party/WebKit/public/web/WebKit.h" #include "third_party/WebKit/public/web/WebKit.h"
#if defined(USE_AURA) #if defined(USE_AURA)
#include "ui/aura/env.h" #include "ui/aura/test/aura_test_suite_setup.h"
#endif #endif
#if defined(USE_X11) #if defined(USE_X11)
...@@ -27,8 +28,7 @@ UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite) ...@@ -27,8 +28,7 @@ UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite)
XInitThreads(); XInitThreads();
#endif #endif
#if defined(USE_AURA) #if defined(USE_AURA)
DCHECK(!aura::Env::GetInstanceDontCreate()); aura_test_suite_setup_ = std::make_unique<aura::AuraTestSuiteSetup>();
env_ = aura::Env::CreateInstance();
#endif #endif
DCHECK(test_suite); DCHECK(test_suite);
blink_test_support_.reset(new TestBlinkWebUnitTestSupport); blink_test_support_.reset(new TestBlinkWebUnitTestSupport);
...@@ -37,7 +37,7 @@ UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite) ...@@ -37,7 +37,7 @@ UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite)
UnitTestTestSuite::~UnitTestTestSuite() { UnitTestTestSuite::~UnitTestTestSuite() {
blink_test_support_.reset(); blink_test_support_.reset();
#if defined(USE_AURA) #if defined(USE_AURA)
env_.reset(); aura_test_suite_setup_.reset();
#endif #endif
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#if defined(USE_AURA) #if defined(USE_AURA)
namespace aura { namespace aura {
class Env; class AuraTestSuiteSetup;
} }
#endif #endif
...@@ -41,7 +41,7 @@ class UnitTestTestSuite { ...@@ -41,7 +41,7 @@ class UnitTestTestSuite {
std::unique_ptr<TestBlinkWebUnitTestSupport> blink_test_support_; std::unique_ptr<TestBlinkWebUnitTestSupport> blink_test_support_;
#if defined(USE_AURA) #if defined(USE_AURA)
std::unique_ptr<aura::Env> env_; std::unique_ptr<aura::AuraTestSuiteSetup> aura_test_suite_setup_;
#endif #endif
DISALLOW_COPY_AND_ASSIGN(UnitTestTestSuite); DISALLOW_COPY_AND_ASSIGN(UnitTestTestSuite);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "ui/aura/mus/window_tree_client_delegate.h" #include "ui/aura/mus/window_tree_client_delegate.h"
#include "ui/aura/mus/window_tree_host_mus.h" #include "ui/aura/mus/window_tree_host_mus.h"
#include "ui/aura/mus/window_tree_host_mus_init_params.h" #include "ui/aura/mus/window_tree_host_mus_init_params.h"
#include "ui/aura/test/mus/test_window_manager_delegate.h"
#include "ui/aura/test/mus/window_tree_client_private.h" #include "ui/aura/test/mus/window_tree_client_private.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/aura/window_observer.h" #include "ui/aura/window_observer.h"
...@@ -40,69 +41,6 @@ aura::Window* GetChildWindowByServerId(aura::WindowTreeClient* client, ...@@ -40,69 +41,6 @@ aura::Window* GetChildWindowByServerId(aura::WindowTreeClient* client,
return aura::WindowTreeClientPrivate(client).GetWindowByServerId(id); return aura::WindowTreeClientPrivate(client).GetWindowByServerId(id);
} }
class TestWindowManagerDelegate : public aura::WindowManagerDelegate {
public:
TestWindowManagerDelegate() {}
~TestWindowManagerDelegate() override {}
// WindowManagerDelegate:
void SetWindowManagerClient(aura::WindowManagerClient* client) override {}
void OnWmAcceleratedWidgetAvailableForDisplay(
int64_t display_id,
gfx::AcceleratedWidget widget) override {}
void OnWmConnected() override {}
void OnWmSetBounds(aura::Window* window, const gfx::Rect& bounds) override {}
bool OnWmSetProperty(
aura::Window* window,
const std::string& name,
std::unique_ptr<std::vector<uint8_t>>* new_data) override {
return false;
}
void OnWmSetModalType(aura::Window* window, ui::ModalType type) override {}
void OnWmSetCanFocus(aura::Window* window, bool can_focus) override {}
aura::Window* OnWmCreateTopLevelWindow(
ui::mojom::WindowType window_type,
std::map<std::string, std::vector<uint8_t>>* properties) override {
return nullptr;
}
void OnWmClientJankinessChanged(const std::set<aura::Window*>& client_windows,
bool not_responding) override {}
void OnWmBuildDragImage(const gfx::Point& screen_location,
const SkBitmap& drag_image,
const gfx::Vector2d& drag_image_offset,
ui::mojom::PointerKind source) override {}
void OnWmMoveDragImage(const gfx::Point& screen_location) override {}
void OnWmDestroyDragImage() override {}
void OnWmWillCreateDisplay(const display::Display& display) override {}
void OnWmNewDisplay(std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
const display::Display& display) override {}
void OnWmDisplayRemoved(aura::WindowTreeHostMus* window_tree_host) override {}
void OnWmDisplayModified(const display::Display& display) override {}
mojom::EventResult OnAccelerator(
uint32_t accelerator_id,
const ui::Event& event,
std::unordered_map<std::string, std::vector<uint8_t>>* properties)
override {
return ui::mojom::EventResult::UNHANDLED;
}
void OnCursorTouchVisibleChanged(bool enabled) override {}
void OnWmPerformMoveLoop(aura::Window* window,
mojom::MoveLoopSource source,
const gfx::Point& cursor_location,
const base::Callback<void(bool)>& on_done) override {
}
void OnWmCancelMoveLoop(aura::Window* window) override {}
void OnWmSetClientArea(
aura::Window* window,
const gfx::Insets& insets,
const std::vector<gfx::Rect>& additional_client_areas) override {}
bool IsWindowActive(aura::Window* window) override { return true; }
void OnWmDeactivateWindow(aura::Window* window) override {}
private:
DISALLOW_COPY_AND_ASSIGN(TestWindowManagerDelegate);
};
class BoundsChangeObserver : public aura::WindowObserver { class BoundsChangeObserver : public aura::WindowObserver {
public: public:
explicit BoundsChangeObserver(aura::Window* window) : window_(window) { explicit BoundsChangeObserver(aura::Window* window) : window_(window) {
...@@ -444,7 +382,7 @@ TEST_F(WindowServerTest, SetBounds) { ...@@ -444,7 +382,7 @@ TEST_F(WindowServerTest, SetBounds) {
// Verifies that bounds changes applied to a window owned by a different // Verifies that bounds changes applied to a window owned by a different
// client can be refused. // client can be refused.
TEST_F(WindowServerTest, SetBoundsSecurity) { TEST_F(WindowServerTest, SetBoundsSecurity) {
TestWindowManagerDelegate wm_delegate; aura::TestWindowManagerDelegate wm_delegate;
set_window_manager_delegate(&wm_delegate); set_window_manager_delegate(&wm_delegate);
aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(), aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
...@@ -703,7 +641,8 @@ TEST_F(WindowServerTest, ClientAreaChanged) { ...@@ -703,7 +641,8 @@ TEST_F(WindowServerTest, ClientAreaChanged) {
EXPECT_EQ(insets, client_area_change->insets); EXPECT_EQ(insets, client_area_change->insets);
} }
class EstablishConnectionViaFactoryDelegate : public TestWindowManagerDelegate { class EstablishConnectionViaFactoryDelegate
: public aura::TestWindowManagerDelegate {
public: public:
explicit EstablishConnectionViaFactoryDelegate(aura::WindowTreeClient* client) explicit EstablishConnectionViaFactoryDelegate(aura::WindowTreeClient* client)
: client_(client), run_loop_(nullptr), created_window_(nullptr) {} : client_(client), run_loop_(nullptr), created_window_(nullptr) {}
......
...@@ -227,8 +227,11 @@ static_library("test_support") { ...@@ -227,8 +227,11 @@ static_library("test_support") {
"test/aura_test_context_factory.h", "test/aura_test_context_factory.h",
"test/aura_test_helper.cc", "test/aura_test_helper.cc",
"test/aura_test_helper.h", "test/aura_test_helper.h",
"test/aura_test_suite_setup.cc",
"test/aura_test_suite_setup.h",
"test/aura_test_utils.cc", "test/aura_test_utils.cc",
"test/aura_test_utils.h", "test/aura_test_utils.h",
"test/env_test_helper.cc",
"test/env_test_helper.h", "test/env_test_helper.h",
"test/event_generator_delegate_aura.cc", "test/event_generator_delegate_aura.cc",
"test/event_generator_delegate_aura.h", "test/event_generator_delegate_aura.h",
...@@ -237,8 +240,12 @@ static_library("test_support") { ...@@ -237,8 +240,12 @@ static_library("test_support") {
"test/mus/input_method_mus_test_api.h", "test/mus/input_method_mus_test_api.h",
"test/mus/test_window_manager_client.cc", "test/mus/test_window_manager_client.cc",
"test/mus/test_window_manager_client.h", "test/mus/test_window_manager_client.h",
"test/mus/test_window_manager_delegate.cc",
"test/mus/test_window_manager_delegate.h",
"test/mus/test_window_tree.cc", "test/mus/test_window_tree.cc",
"test/mus/test_window_tree.h", "test/mus/test_window_tree.h",
"test/mus/test_window_tree_client_delegate.cc",
"test/mus/test_window_tree_client_delegate.h",
"test/mus/test_window_tree_client_setup.cc", "test/mus/test_window_tree_client_setup.cc",
"test/mus/test_window_tree_client_setup.h", "test/mus/test_window_tree_client_setup.h",
"test/mus/window_tree_client_private.cc", "test/mus/window_tree_client_private.cc",
...@@ -269,11 +276,15 @@ static_library("test_support") { ...@@ -269,11 +276,15 @@ static_library("test_support") {
public_deps = [ public_deps = [
":aura", ":aura",
# Must be public as headers include ui_features.h.
"//ui/base:ui_features",
] ]
deps = [ deps = [
"//base/test:test_support", "//base/test:test_support",
"//cc:test_support", "//cc:test_support",
"//components/viz/test:test_support", "//components/viz/test:test_support",
"//services/ui/public/cpp/input_devices",
"//services/ui/public/interfaces", "//services/ui/public/interfaces",
"//skia", "//skia",
"//testing/gtest", "//testing/gtest",
......
...@@ -48,6 +48,7 @@ class WindowTreeClient; ...@@ -48,6 +48,7 @@ class WindowTreeClient;
namespace aura { namespace aura {
namespace test { namespace test {
class EnvTestHelper; class EnvTestHelper;
class EnvWindowTreeClientSetter;
} }
class EnvInputStateController; class EnvInputStateController;
...@@ -137,6 +138,7 @@ class AURA_EXPORT Env : public ui::EventTarget, ...@@ -137,6 +138,7 @@ class AURA_EXPORT Env : public ui::EventTarget,
private: private:
friend class test::EnvTestHelper; friend class test::EnvTestHelper;
friend class test::EnvWindowTreeClientSetter;
friend class EventInjector; friend class EventInjector;
friend class MusMouseLocationUpdater; friend class MusMouseLocationUpdater;
friend class Window; friend class Window;
......
...@@ -2,6 +2,7 @@ include_rules = [ ...@@ -2,6 +2,7 @@ include_rules = [
"+cc/test", "+cc/test",
"+components/viz/test", "+components/viz/test",
"+mojo/edk/embedder/embedder.h", "+mojo/edk/embedder/embedder.h",
"+services/ui/public/cpp/input_devices",
"+ui/gl", "+ui/gl",
"+ui/wm/core/wm_state.h", "+ui/wm/core/wm_state.h",
] ]
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
#include "ui/aura/mus/window_tree_client.h" #include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/test/env_test_helper.h" #include "ui/aura/test/env_test_helper.h"
#include "ui/aura/test/event_generator_delegate_aura.h" #include "ui/aura/test/event_generator_delegate_aura.h"
#include "ui/aura/test/mus/test_window_manager_delegate.h"
#include "ui/aura/test/mus/test_window_tree.h" #include "ui/aura/test/mus/test_window_tree.h"
#include "ui/aura/test/mus/test_window_tree_client_delegate.h"
#include "ui/aura/test/mus/test_window_tree_client_setup.h" #include "ui/aura/test/mus/test_window_tree_client_setup.h"
#include "ui/aura/test/test_focus_client.h" #include "ui/aura/test/test_focus_client.h"
#include "ui/aura/test/test_screen.h" #include "ui/aura/test/test_screen.h"
...@@ -94,6 +96,19 @@ void AuraTestHelper::DeleteWindowTreeClient() { ...@@ -94,6 +96,19 @@ void AuraTestHelper::DeleteWindowTreeClient() {
void AuraTestHelper::SetUp(ui::ContextFactory* context_factory, void AuraTestHelper::SetUp(ui::ContextFactory* context_factory,
ui::ContextFactoryPrivate* context_factory_private) { ui::ContextFactoryPrivate* context_factory_private) {
// |mode_| defaults to LOCAL, but test suites may enable MUS. If this happens
// enable mus.
if (Env::GetInstanceDontCreate() &&
Env::GetInstanceDontCreate()->mode() == Env::Mode::MUS &&
mode_ == Mode::LOCAL) {
test_window_tree_client_delegate_ =
std::make_unique<TestWindowTreeClientDelegate>();
test_window_manager_delegate_ =
std::make_unique<TestWindowManagerDelegate>();
EnableMusWithTestWindowTree(test_window_tree_client_delegate_.get(),
test_window_manager_delegate_.get());
}
setup_called_ = true; setup_called_ = true;
if (mode_ != Mode::MUS) { if (mode_ != Mode::MUS) {
...@@ -121,7 +136,10 @@ void AuraTestHelper::SetUp(ui::ContextFactory* context_factory, ...@@ -121,7 +136,10 @@ void AuraTestHelper::SetUp(ui::ContextFactory* context_factory,
// Always reset the mode. This really only matters for if Env was created // Always reset the mode. This really only matters for if Env was created
// above. // above.
env_helper.SetMode(env_mode); env_helper.SetMode(env_mode);
env_helper.SetWindowTreeClient(window_tree_client_); if (env_mode == Env::Mode::MUS) {
env_window_tree_client_setter_ =
std::make_unique<EnvWindowTreeClientSetter>(window_tree_client_);
}
// Tests assume they can set the mouse location on Env() and have it reflected // Tests assume they can set the mouse location on Env() and have it reflected
// in tests. // in tests.
env_helper.SetAlwaysUseLastMouseLocation(true); env_helper.SetAlwaysUseLastMouseLocation(true);
...@@ -175,6 +193,7 @@ void AuraTestHelper::TearDown() { ...@@ -175,6 +193,7 @@ void AuraTestHelper::TearDown() {
g_instance = nullptr; g_instance = nullptr;
teardown_called_ = true; teardown_called_ = true;
parenting_client_.reset(); parenting_client_.reset();
env_window_tree_client_setter_.reset();
if (mode_ != Mode::MUS && root_window()) { if (mode_ != Mode::MUS && root_window()) {
client::SetFocusClient(root_window(), nullptr); client::SetFocusClient(root_window(), nullptr);
client::SetCaptureClient(root_window(), nullptr); client::SetCaptureClient(root_window(), nullptr);
......
...@@ -25,7 +25,9 @@ class WMState; ...@@ -25,7 +25,9 @@ class WMState;
namespace aura { namespace aura {
class Env; class Env;
class TestScreen; class TestScreen;
class TestWindowManagerDelegate;
class TestWindowTree; class TestWindowTree;
class TestWindowTreeClientDelegate;
class TestWindowTreeClientSetup; class TestWindowTreeClientSetup;
class Window; class Window;
class WindowManagerDelegate; class WindowManagerDelegate;
...@@ -38,6 +40,7 @@ class DefaultCaptureClient; ...@@ -38,6 +40,7 @@ class DefaultCaptureClient;
class FocusClient; class FocusClient;
} }
namespace test { namespace test {
class EnvWindowTreeClientSetter;
class TestWindowParentingClient; class TestWindowParentingClient;
// A helper class owned by tests that does common initialization required for // A helper class owned by tests that does common initialization required for
...@@ -117,6 +120,12 @@ class AuraTestHelper { ...@@ -117,6 +120,12 @@ class AuraTestHelper {
bool teardown_called_; bool teardown_called_;
ui::ContextFactory* context_factory_to_restore_ = nullptr; ui::ContextFactory* context_factory_to_restore_ = nullptr;
ui::ContextFactoryPrivate* context_factory_private_to_restore_ = nullptr; ui::ContextFactoryPrivate* context_factory_private_to_restore_ = nullptr;
std::unique_ptr<EnvWindowTreeClientSetter> env_window_tree_client_setter_;
// This is only created if Env has already been created and it's Mode is MUS.
std::unique_ptr<TestWindowTreeClientDelegate>
test_window_tree_client_delegate_;
// This is only created if Env has already been created and it's Mode is MUS.
std::unique_ptr<TestWindowManagerDelegate> test_window_manager_delegate_;
std::unique_ptr<TestWindowTreeClientSetup> window_tree_client_setup_; std::unique_ptr<TestWindowTreeClientSetup> window_tree_client_setup_;
Env::Mode env_mode_to_restore_ = Env::Mode::LOCAL; Env::Mode env_mode_to_restore_ = Env::Mode::LOCAL;
std::unique_ptr<aura::Env> env_; std::unique_ptr<aura::Env> env_;
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/aura/test/aura_test_suite_setup.h"
#include "base/command_line.h"
#include "ui/aura/env.h"
#include "ui/aura/test/aura_test_context_factory.h"
#include "ui/base/ui_base_switches.h"
#if defined(USE_OZONE)
#include "services/ui/public/cpp/input_devices/input_device_client.h"
#endif
#if BUILDFLAG(ENABLE_MUS)
#include "ui/aura/test/mus/test_window_tree_client_delegate.h"
#include "ui/aura/test/mus/test_window_tree_client_setup.h"
#endif
namespace aura {
namespace {
#if defined(USE_OZONE)
class TestInputDeviceClient : public ui::InputDeviceClient {
public:
TestInputDeviceClient() = default;
~TestInputDeviceClient() override = default;
using InputDeviceClient::GetIntefacePtr;
private:
DISALLOW_COPY_AND_ASSIGN(TestInputDeviceClient);
};
#endif
} // namespace
AuraTestSuiteSetup::AuraTestSuiteSetup() {
DCHECK(!Env::GetInstanceDontCreate());
#if BUILDFLAG(ENABLE_MUS)
const Env::Mode env_mode =
base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kMus)
? Env::Mode::MUS
: Env::Mode::LOCAL;
env_ = Env::CreateInstance(env_mode);
if (env_mode == Env::Mode::MUS)
ConfigureMus();
#else
env_ = Env::CreateInstance(Env::Mode::LOCAL);
#endif
}
AuraTestSuiteSetup::~AuraTestSuiteSetup() = default;
#if BUILDFLAG(ENABLE_MUS)
void AuraTestSuiteSetup::ConfigureMus() {
// Configure the WindowTreeClient in a mode similar to that of connecting via
// a WindowTreeFactory. This gives WindowTreeClient a mock WindowTree.
test_window_tree_client_delegate_ =
std::make_unique<TestWindowTreeClientDelegate>();
window_tree_client_setup_ = std::make_unique<TestWindowTreeClientSetup>();
window_tree_client_setup_->InitWithoutEmbed(
test_window_tree_client_delegate_.get());
env_->SetWindowTreeClient(window_tree_client_setup_->window_tree_client());
#if defined(USE_OZONE)
input_device_client_ = std::make_unique<TestInputDeviceClient>();
#endif
context_factory_ = std::make_unique<test::AuraTestContextFactory>();
env_->set_context_factory(context_factory_.get());
env_->set_context_factory_private(nullptr);
}
#endif
} // namespace aura
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_AURA_TEST_AURA_TEST_SUITE_SETUP_H_
#define UI_AURA_TEST_AURA_TEST_SUITE_SETUP_H_
#include <memory>
#include "base/macros.h"
#include "ui/base/ui_features.h"
namespace ui {
class ContextFactory;
class InputDeviceClient;
} // namespace ui
namespace aura {
class Env;
#if BUILDFLAG(ENABLE_MUS)
class TestWindowTreeClientDelegate;
class TestWindowTreeClientSetup;
#endif
// Use this in TestSuites that use aura. It configures aura appropriately based
// on the command line.
class AuraTestSuiteSetup {
public:
AuraTestSuiteSetup();
~AuraTestSuiteSetup();
private:
#if BUILDFLAG(ENABLE_MUS)
void ConfigureMus();
#endif
std::unique_ptr<aura::Env> env_;
#if BUILDFLAG(ENABLE_MUS)
std::unique_ptr<ui::ContextFactory> context_factory_;
std::unique_ptr<TestWindowTreeClientDelegate>
test_window_tree_client_delegate_;
std::unique_ptr<TestWindowTreeClientSetup> window_tree_client_setup_;
#endif
#if defined(USE_OZONE)
std::unique_ptr<ui::InputDeviceClient> input_device_client_;
#endif
DISALLOW_COPY_AND_ASSIGN(AuraTestSuiteSetup);
};
} // namespace aura
#endif // UI_AURA_TEST_AURA_TEST_SUITE_SETUP_H_
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/aura/test/env_test_helper.h"
namespace aura {
namespace test {
EnvWindowTreeClientSetter::EnvWindowTreeClientSetter(WindowTreeClient* client)
: supplied_client_(client),
previous_client_(Env::GetInstance()->window_tree_client_) {
DCHECK(client);
SetWindowTreeClient(client);
}
EnvWindowTreeClientSetter::~EnvWindowTreeClientSetter() {
// |supplied_client_| may have already been deleted.
DCHECK(Env::GetInstance()->window_tree_client_ == nullptr ||
Env::GetInstance()->window_tree_client_ == supplied_client_);
SetWindowTreeClient(previous_client_);
}
void EnvWindowTreeClientSetter::SetWindowTreeClient(WindowTreeClient* client) {
Env* env = Env::GetInstance();
env->window_tree_client_ = client;
env->in_mus_shutdown_ = client ? false : true;
}
} // namespace test
} // namespace aura
...@@ -15,6 +15,23 @@ ...@@ -15,6 +15,23 @@
namespace aura { namespace aura {
namespace test { namespace test {
// Used to set the WindowTreeClient of Env. The constructor installs the
// supplied WindowTreeClient and the destructor restores the WindowTreeClient
// to what it previously was.
class EnvWindowTreeClientSetter {
public:
explicit EnvWindowTreeClientSetter(WindowTreeClient* client);
~EnvWindowTreeClientSetter();
private:
void SetWindowTreeClient(WindowTreeClient* client);
WindowTreeClient* supplied_client_;
WindowTreeClient* previous_client_;
DISALLOW_COPY_AND_ASSIGN(EnvWindowTreeClientSetter);
};
class EnvTestHelper { class EnvTestHelper {
public: public:
EnvTestHelper() : EnvTestHelper(Env::GetInstance()) {} EnvTestHelper() : EnvTestHelper(Env::GetInstance()) {}
...@@ -39,15 +56,6 @@ class EnvTestHelper { ...@@ -39,15 +56,6 @@ class EnvTestHelper {
env_->EnableMusOSExchangeDataProvider(); env_->EnableMusOSExchangeDataProvider();
} }
WindowTreeClient* GetWindowTreeClient() { return env_->window_tree_client_; }
// This circumvents the DCHECKs in Env::SetWindowTreeClient() and should
// only be used for tests where Env is long lived.
void SetWindowTreeClient(WindowTreeClient* window_tree_client) {
env_->window_tree_client_ = window_tree_client;
env_->in_mus_shutdown_ = window_tree_client ? false : true;
}
// Use to force Env::last_mouse_location() to return the value last set. // Use to force Env::last_mouse_location() to return the value last set.
// This matters for MUS, which may not return the last explicitly set // This matters for MUS, which may not return the last explicitly set
// location. // location.
...@@ -55,6 +63,8 @@ class EnvTestHelper { ...@@ -55,6 +63,8 @@ class EnvTestHelper {
env_->always_use_last_mouse_location_ = value; env_->always_use_last_mouse_location_ = value;
} }
WindowTreeClient* GetWindowTreeClient() { return env_->window_tree_client_; }
private: private:
Env* env_; Env* env_;
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/aura/test/mus/test_window_manager_delegate.h"
#include "ui/aura/mus/window_tree_host_mus.h"
namespace aura {
TestWindowManagerDelegate::TestWindowManagerDelegate() = default;
TestWindowManagerDelegate::~TestWindowManagerDelegate() = default;
void TestWindowManagerDelegate::SetWindowManagerClient(
aura::WindowManagerClient* client) {}
void TestWindowManagerDelegate::OnWmAcceleratedWidgetAvailableForDisplay(
int64_t display_id,
gfx::AcceleratedWidget widget) {}
void TestWindowManagerDelegate::OnWmConnected() {}
void TestWindowManagerDelegate::OnWmSetBounds(aura::Window* window,
const gfx::Rect& bounds) {}
bool TestWindowManagerDelegate::OnWmSetProperty(
aura::Window* window,
const std::string& name,
std::unique_ptr<std::vector<uint8_t>>* new_data) {
return false;
}
void TestWindowManagerDelegate::OnWmSetModalType(aura::Window* window,
ui::ModalType type) {}
void TestWindowManagerDelegate::OnWmSetCanFocus(aura::Window* window,
bool can_focus) {}
aura::Window* TestWindowManagerDelegate::OnWmCreateTopLevelWindow(
ui::mojom::WindowType window_type,
std::map<std::string, std::vector<uint8_t>>* properties) {
return nullptr;
}
void TestWindowManagerDelegate::OnWmClientJankinessChanged(
const std::set<aura::Window*>& client_windows,
bool not_responding) {}
void TestWindowManagerDelegate::OnWmBuildDragImage(
const gfx::Point& screen_location,
const SkBitmap& drag_image,
const gfx::Vector2d& drag_image_offset,
ui::mojom::PointerKind source) {}
void TestWindowManagerDelegate::OnWmMoveDragImage(
const gfx::Point& screen_location) {}
void TestWindowManagerDelegate::OnWmDestroyDragImage() {}
void TestWindowManagerDelegate::OnWmWillCreateDisplay(
const display::Display& display) {}
void TestWindowManagerDelegate::OnWmNewDisplay(
std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
const display::Display& display) {
// We assume someone else is taking ownership (which is the case for
// AuraTestHelper).
window_tree_hosts_.push_back(window_tree_host.release());
}
void TestWindowManagerDelegate::OnWmDisplayRemoved(
aura::WindowTreeHostMus* window_tree_host) {}
void TestWindowManagerDelegate::OnWmDisplayModified(
const display::Display& display) {}
ui::mojom::EventResult TestWindowManagerDelegate::OnAccelerator(
uint32_t accelerator_id,
const ui::Event& event,
std::unordered_map<std::string, std::vector<uint8_t>>* properties) {
return ui::mojom::EventResult::UNHANDLED;
}
void TestWindowManagerDelegate::OnCursorTouchVisibleChanged(bool enabled) {}
void TestWindowManagerDelegate::OnWmPerformMoveLoop(
aura::Window* window,
ui::mojom::MoveLoopSource source,
const gfx::Point& cursor_location,
const base::Callback<void(bool)>& on_done) {}
void TestWindowManagerDelegate::OnWmCancelMoveLoop(aura::Window* window) {}
void TestWindowManagerDelegate::OnWmSetClientArea(
aura::Window* window,
const gfx::Insets& insets,
const std::vector<gfx::Rect>& additional_client_areas) {}
bool TestWindowManagerDelegate::IsWindowActive(aura::Window* window) {
return true;
}
void TestWindowManagerDelegate::OnWmDeactivateWindow(aura::Window* window) {}
} // namespace aura
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_AURA_TEST_MUS_TEST_WINDOW_MANAGER_DELEGATE_H_
#define UI_AURA_TEST_MUS_TEST_WINDOW_MANAGER_DELEGATE_H_
#include <memory>
#include <vector>
#include "base/macros.h"
#include "ui/aura/mus/window_manager_delegate.h"
namespace aura {
class TestWindowManagerDelegate : public aura::WindowManagerDelegate {
public:
TestWindowManagerDelegate();
~TestWindowManagerDelegate() override;
// WindowManagerDelegate:
void SetWindowManagerClient(aura::WindowManagerClient* client) override;
void OnWmAcceleratedWidgetAvailableForDisplay(
int64_t display_id,
gfx::AcceleratedWidget widget) override;
void OnWmConnected() override;
void OnWmSetBounds(aura::Window* window, const gfx::Rect& bounds) override;
bool OnWmSetProperty(
aura::Window* window,
const std::string& name,
std::unique_ptr<std::vector<uint8_t>>* new_data) override;
void OnWmSetModalType(aura::Window* window, ui::ModalType type) override;
void OnWmSetCanFocus(aura::Window* window, bool can_focus) override;
aura::Window* OnWmCreateTopLevelWindow(
ui::mojom::WindowType window_type,
std::map<std::string, std::vector<uint8_t>>* properties) override;
void OnWmClientJankinessChanged(const std::set<aura::Window*>& client_windows,
bool not_responding) override;
void OnWmBuildDragImage(const gfx::Point& screen_location,
const SkBitmap& drag_image,
const gfx::Vector2d& drag_image_offset,
ui::mojom::PointerKind source) override;
void OnWmMoveDragImage(const gfx::Point& screen_location) override;
void OnWmDestroyDragImage() override;
void OnWmWillCreateDisplay(const display::Display& display) override;
void OnWmNewDisplay(std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
const display::Display& display) override;
void OnWmDisplayRemoved(aura::WindowTreeHostMus* window_tree_host) override;
void OnWmDisplayModified(const display::Display& display) override;
ui::mojom::EventResult OnAccelerator(
uint32_t accelerator_id,
const ui::Event& event,
std::unordered_map<std::string, std::vector<uint8_t>>* properties)
override;
void OnCursorTouchVisibleChanged(bool enabled) override;
void OnWmPerformMoveLoop(aura::Window* window,
ui::mojom::MoveLoopSource source,
const gfx::Point& cursor_location,
const base::Callback<void(bool)>& on_done) override;
void OnWmCancelMoveLoop(aura::Window* window) override;
void OnWmSetClientArea(
aura::Window* window,
const gfx::Insets& insets,
const std::vector<gfx::Rect>& additional_client_areas) override;
bool IsWindowActive(aura::Window* window) override;
void OnWmDeactivateWindow(aura::Window* window) override;
private:
std::vector<WindowTreeHostMus*> window_tree_hosts_;
DISALLOW_COPY_AND_ASSIGN(TestWindowManagerDelegate);
};
} // namespace aura
#endif // UI_AURA_TEST_MUS_TEST_WINDOW_MANAGER_DELEGATE_H_
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/aura/test/mus/test_window_tree_client_delegate.h"
#include "ui/aura/mus/property_converter.h"
#include "ui/aura/mus/window_tree_host_mus.h"
namespace aura {
TestWindowTreeClientDelegate::TestWindowTreeClientDelegate()
: property_converter_(std::make_unique<PropertyConverter>()) {}
TestWindowTreeClientDelegate::~TestWindowTreeClientDelegate() = default;
void TestWindowTreeClientDelegate::OnEmbed(
std::unique_ptr<WindowTreeHostMus> window_tree_host) {}
void TestWindowTreeClientDelegate::OnUnembed(Window* root) {}
void TestWindowTreeClientDelegate::OnEmbedRootDestroyed(
WindowTreeHostMus* window_tree_host) {}
void TestWindowTreeClientDelegate::OnLostConnection(WindowTreeClient* client) {}
void TestWindowTreeClientDelegate::OnPointerEventObserved(
const ui::PointerEvent& event,
Window* target) {}
PropertyConverter* TestWindowTreeClientDelegate::GetPropertyConverter() {
return property_converter_.get();
}
} // namespace aura
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_DELEGATE_H_
#define UI_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_DELEGATE_H_
#include <memory>
#include "ui/aura/mus/window_tree_client_delegate.h"
namespace aura {
class PropertyConverter;
class TestWindowTreeClientDelegate : public WindowTreeClientDelegate {
public:
TestWindowTreeClientDelegate();
~TestWindowTreeClientDelegate() override;
// WindowTreeClientDelegate:
void OnEmbed(std::unique_ptr<WindowTreeHostMus> window_tree_host) override;
void OnUnembed(Window* root) override;
void OnEmbedRootDestroyed(WindowTreeHostMus* window_tree_host) override;
void OnLostConnection(WindowTreeClient* client) override;
void OnPointerEventObserved(const ui::PointerEvent& event,
Window* target) override;
PropertyConverter* GetPropertyConverter() override;
private:
std::unique_ptr<PropertyConverter> property_converter_;
DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientDelegate);
};
} // namespace aura
#endif // UI_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_DELEGATE_H_
...@@ -35,6 +35,13 @@ void TestWindowTreeClientSetup::InitForWindowManager( ...@@ -35,6 +35,13 @@ void TestWindowTreeClientSetup::InitForWindowManager(
test_window_manager_client_.get()); test_window_manager_client_.get());
} }
void TestWindowTreeClientSetup::InitWithoutEmbed(
WindowTreeClientDelegate* window_tree_delegate) {
CommonInit(window_tree_delegate, nullptr);
WindowTreeClientPrivate(window_tree_client_.get())
.SetTree(window_tree_.get());
}
std::unique_ptr<WindowTreeClient> std::unique_ptr<WindowTreeClient>
TestWindowTreeClientSetup::OwnWindowTreeClient() { TestWindowTreeClientSetup::OwnWindowTreeClient() {
DCHECK(window_tree_client_); DCHECK(window_tree_client_);
......
...@@ -28,6 +28,8 @@ class TestWindowTreeClientSetup { ...@@ -28,6 +28,8 @@ class TestWindowTreeClientSetup {
void Init(WindowTreeClientDelegate* window_tree_delegate); void Init(WindowTreeClientDelegate* window_tree_delegate);
void InitForWindowManager(WindowTreeClientDelegate* window_tree_delegate, void InitForWindowManager(WindowTreeClientDelegate* window_tree_delegate,
WindowManagerDelegate* window_manager_delegate); WindowManagerDelegate* window_manager_delegate);
// TODO(sky): see if can combine with Init().
void InitWithoutEmbed(WindowTreeClientDelegate* window_tree_delegate);
// The WindowTree that WindowTreeClient talks to. // The WindowTree that WindowTreeClient talks to.
TestWindowTree* window_tree() { return window_tree_.get(); } TestWindowTree* window_tree() { return window_tree_.get(); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment