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

Unified Diff: components/mus/public/cpp/tests/window_server_test_base.cc

Issue 2018823002: Eliminate WindowTreeConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connection
Patch Set: . Created 4 years, 7 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: components/mus/public/cpp/tests/window_server_test_base.cc
diff --git a/components/mus/public/cpp/tests/window_server_test_base.cc b/components/mus/public/cpp/tests/window_server_test_base.cc
index d7d8e8d6d3273470eae8d8ff6a33dca9e5480844..22c8244cefef9a24deace9400a579d885b45d8eb 100644
--- a/components/mus/public/cpp/tests/window_server_test_base.cc
+++ b/components/mus/public/cpp/tests/window_server_test_base.cc
@@ -9,7 +9,7 @@
#include "base/run_loop.h"
#include "base/test/test_timeouts.h"
#include "components/mus/public/cpp/window.h"
-#include "components/mus/public/cpp/window_tree_connection.h"
+#include "components/mus/public/cpp/window_tree_client.h"
#include "components/mus/public/cpp/window_tree_host_factory.h"
#include "services/shell/public/cpp/connector.h"
@@ -27,11 +27,11 @@ void TimeoutRunLoop(const base::Closure& timeout_task, bool* timeout) {
} // namespace
WindowServerTestBase::WindowServerTestBase()
- : most_recent_connection_(nullptr),
+ : most_recent_client_(nullptr),
window_manager_(nullptr),
window_manager_delegate_(nullptr),
window_manager_client_(nullptr),
- window_tree_connection_destroyed_(false) {}
+ window_tree_client_destroyed_(false) {}
WindowServerTestBase::~WindowServerTestBase() {}
@@ -68,7 +68,7 @@ void WindowServerTestBase::SetUp() {
CreateWindowTreeHost(connector(), this, &host_, this);
ASSERT_TRUE(DoRunLoopWithTimeout()); // RunLoop should be quit by OnEmbed().
- std::swap(window_manager_, most_recent_connection_);
+ std::swap(window_manager_, most_recent_client_);
}
bool WindowServerTestBase::AcceptConnection(shell::Connection* connection) {
@@ -77,14 +77,15 @@ bool WindowServerTestBase::AcceptConnection(shell::Connection* connection) {
}
void WindowServerTestBase::OnEmbed(Window* root) {
- most_recent_connection_ = root->connection();
+ most_recent_client_ = root->window_tree();
EXPECT_TRUE(QuitRunLoop());
ASSERT_TRUE(window_manager_client_);
window_manager_client_->AddActivationParent(root);
}
-void WindowServerTestBase::OnConnectionLost(WindowTreeConnection* connection) {
- window_tree_connection_destroyed_ = true;
+void WindowServerTestBase::OnWindowTreeClientDestroyed(
+ WindowTreeClient* client) {
+ window_tree_client_destroyed_ = true;
}
void WindowServerTestBase::OnEventObserved(const ui::Event& event,
@@ -128,12 +129,9 @@ void WindowServerTestBase::OnAccelerator(uint32_t id, const ui::Event& event) {
window_manager_delegate_->OnAccelerator(id, event);
}
-void WindowServerTestBase::Create(
- shell::Connection* connection,
- mojo::InterfaceRequest<mojom::WindowTreeClient> request) {
- WindowTreeConnection::Create(
- this, std::move(request),
- WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED);
+void WindowServerTestBase::Create(shell::Connection* connection,
+ mojom::WindowTreeClientRequest request) {
+ new WindowTreeClient(this, nullptr, std::move(request));
}
} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698