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

Unified Diff: services/ui/public/cpp/tests/window_server_test_base.cc

Issue 2438193003: Migrate WindowServerTestBase to be a WM client. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/public/cpp/tests/window_server_test_base.cc
diff --git a/services/ui/public/cpp/tests/window_server_test_base.cc b/services/ui/public/cpp/tests/window_server_test_base.cc
index 7cb9b7fed3613726a7e150387281d246fa7f082f..43582f7284a99f24959655384b9ed36088899b28 100644
--- a/services/ui/public/cpp/tests/window_server_test_base.cc
+++ b/services/ui/public/cpp/tests/window_server_test_base.cc
@@ -14,7 +14,6 @@
#include "services/service_manager/public/cpp/connector.h"
#include "services/ui/public/cpp/window.h"
#include "services/ui/public/cpp/window_tree_client.h"
-#include "services/ui/public/cpp/window_tree_host_factory.h"
namespace ui {
namespace {
@@ -30,8 +29,7 @@ void TimeoutRunLoop(const base::Closure& timeout_task, bool* timeout) {
} // namespace
WindowServerTestBase::WindowServerTestBase()
- : most_recent_client_(nullptr),
- window_manager_(nullptr),
+ : window_manager_(nullptr),
window_manager_delegate_(nullptr),
window_manager_client_(nullptr) {}
@@ -82,7 +80,8 @@ void WindowServerTestBase::SetUp() {
WindowServerServiceTestBase::SetUp();
std::unique_ptr<WindowTreeClient> window_manager_window_tree_client =
- CreateWindowTreeHost(connector(), this, &host_, this);
+ base::MakeUnique<WindowTreeClient>(this, this);
+ window_manager_window_tree_client->ConnectAsWindowManager(connector());
window_manager_ = window_manager_window_tree_client.get();
window_tree_clients_.insert(std::move(window_manager_window_tree_client));
@@ -97,10 +96,7 @@ bool WindowServerTestBase::OnConnect(
}
void WindowServerTestBase::OnEmbed(Window* root) {
- most_recent_client_ = root->window_tree();
EXPECT_TRUE(QuitRunLoop());
- ASSERT_TRUE(window_manager_client_);
- window_manager_client_->AddActivationParent(root);
}
void WindowServerTestBase::OnLostConnection(WindowTreeClient* client) {
@@ -150,6 +146,10 @@ void WindowServerTestBase::OnWmClientJankinessChanged(
void WindowServerTestBase::OnWmNewDisplay(Window* window,
const display::Display& display) {
+ EXPECT_TRUE(QuitRunLoop());
+ ASSERT_TRUE(window_manager_client_);
+ window_manager_client_->AddActivationParent(window);
+
if (window_manager_delegate_)
window_manager_delegate_->OnWmNewDisplay(window, display);
}
« no previous file with comments | « services/ui/public/cpp/tests/window_server_test_base.h ('k') | services/ui/ws/mus_ws_unittests_app_manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698