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

Unified Diff: components/mus/ws/test_utils.cc

Issue 2072343002: Changes how window manager obtains WindowTree from mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include Created 4 years, 6 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
« no previous file with comments | « components/mus/ws/test_utils.h ('k') | components/mus/ws/user_display_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/test_utils.cc
diff --git a/components/mus/ws/test_utils.cc b/components/mus/ws/test_utils.cc
index bf2d2022f06e5a5390ba051d61d85df9f4431c86..f85f058b98fd42948825e1fc66aa4a20e644c0c7 100644
--- a/components/mus/ws/test_utils.cc
+++ b/components/mus/ws/test_utils.cc
@@ -8,9 +8,10 @@
#include "cc/output/copy_output_request.h"
#include "components/mus/surfaces/surfaces_state.h"
#include "components/mus/ws/display_binding.h"
+#include "components/mus/ws/display_manager.h"
#include "components/mus/ws/server_window_surface_manager_test_api.h"
#include "components/mus/ws/window_manager_access_policy.h"
-#include "components/mus/ws/window_manager_factory_service.h"
+#include "components/mus/ws/window_manager_window_tree_factory.h"
#include "services/shell/public/interfaces/connector.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -75,22 +76,22 @@ ClientWindowId NextUnusedClientWindowId(WindowTree* tree) {
} // namespace
-// WindowManagerFactoryRegistryTestApi ----------------------------------------
+// WindowManagerWindowTreeFactorySetTestApi ------------------------------------
-WindowManagerFactoryRegistryTestApi::WindowManagerFactoryRegistryTestApi(
- WindowManagerFactoryRegistry* registry)
- : registry_(registry) {}
+WindowManagerWindowTreeFactorySetTestApi::
+ WindowManagerWindowTreeFactorySetTestApi(
+ WindowManagerWindowTreeFactorySet*
+ window_manager_window_tree_factory_set)
+ : window_manager_window_tree_factory_set_(
+ window_manager_window_tree_factory_set) {}
-WindowManagerFactoryRegistryTestApi::~WindowManagerFactoryRegistryTestApi() {}
+WindowManagerWindowTreeFactorySetTestApi::
+ ~WindowManagerWindowTreeFactorySetTestApi() {}
-void WindowManagerFactoryRegistryTestApi::AddService(
- const UserId& user_id,
- mojom::WindowManagerFactory* factory) {
- std::unique_ptr<WindowManagerFactoryService> service_ptr(
- new WindowManagerFactoryService(registry_, user_id));
- WindowManagerFactoryService* service = service_ptr.get();
- registry_->AddServiceImpl(std::move(service_ptr));
- service->SetWindowManagerFactoryImpl(factory);
+void WindowManagerWindowTreeFactorySetTestApi::Add(const UserId& user_id) {
+ WindowManagerWindowTreeFactory* factory =
+ window_manager_window_tree_factory_set_->Add(user_id, nullptr);
+ factory->CreateWindowTree(nullptr, nullptr);
}
// TestPlatformDisplayFactory -------------------------------------------------
@@ -442,16 +443,6 @@ void WindowEventTargetingHelper::SetTaskRunner(
// ----------------------------------------------------------------------------
-TestWindowManagerFactory::TestWindowManagerFactory() {}
-
-TestWindowManagerFactory::~TestWindowManagerFactory() {}
-
-void TestWindowManagerFactory::CreateWindowManager(
- mus::mojom::DisplayPtr display,
- mus::mojom::WindowTreeClientRequest client) {}
-
-// ----------------------------------------------------------------------------
-
ServerWindow* FirstRoot(WindowTree* tree) {
return tree->roots().size() == 1u
? tree->GetWindow((*tree->roots().begin())->id())
@@ -473,7 +464,12 @@ ClientWindowId ClientWindowIdForWindow(WindowTree* tree,
}
ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id) {
- ServerWindow* parent = FirstRoot(tree);
+ return NewWindowInTreeWithParent(tree, FirstRoot(tree), client_id);
+}
+
+ServerWindow* NewWindowInTreeWithParent(WindowTree* tree,
+ ServerWindow* parent,
+ ClientWindowId* client_id) {
if (!parent)
return nullptr;
ClientWindowId parent_client_id;
« no previous file with comments | « components/mus/ws/test_utils.h ('k') | components/mus/ws/user_display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698