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

Unified Diff: ash/mus/test/wm_test_base.cc

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: Add blank line back. Remove duplicate function. Created 4 years, 1 month 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 | « ash/mus/test/wm_test_base.h ('k') | ash/mus/window_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/test/wm_test_base.cc
diff --git a/ash/mus/test/wm_test_base.cc b/ash/mus/test/wm_test_base.cc
index c45eb6e73457fd27f8e573754940c7f90f90f533..5f7008870bbf9dd3ae2f106906029aace5f275ee 100644
--- a/ash/mus/test/wm_test_base.cc
+++ b/ash/mus/test/wm_test_base.cc
@@ -94,6 +94,19 @@ display::Display WmTestBase::GetSecondaryDisplay() {
return roots.size() < 2 ? display::Display() : roots[1]->display();
}
+RootWindowController* WmTestBase::GetPrimaryRootWindowController() {
+ std::vector<RootWindowController*> roots =
+ test_helper_->GetRootsOrderedByDisplayId();
+ DCHECK(!roots.empty());
+ return roots[0];
+}
+
+RootWindowController* WmTestBase::GetSecondaryRootWindowController() {
+ std::vector<RootWindowController*> roots =
+ test_helper_->GetRootsOrderedByDisplayId();
+ return roots.size() < 2 ? nullptr : roots[1];
+}
+
ui::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds) {
return CreateTestWindow(bounds, ui::wm::WINDOW_TYPE_NORMAL);
}
@@ -123,14 +136,22 @@ ui::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds,
return window;
}
-ui::Window* WmTestBase::CreateFullscreenTestWindow() {
+ui::Window* WmTestBase::CreateFullscreenTestWindow(
+ RootWindowController* root = nullptr) {
std::map<std::string, std::vector<uint8_t>> properties;
properties[ui::mojom::WindowManager::kShowState_Property] =
mojo::ConvertTo<std::vector<uint8_t>>(
static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN));
- ui::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0]
- ->window_manager()
- ->NewTopLevelWindow(&properties);
+
+ ui::Window* window = nullptr;
+ if (root) {
+ properties[ui::mojom::WindowManager::kInitialDisplayId_Property] =
+ mojo::ConvertTo<std::vector<uint8_t>>(root->display().id());
+ window = root->window_manager()->NewTopLevelWindow(&properties);
mfomitchev 2016/11/18 20:35:58 I think window manager is the same for all root wi
thanhph 2016/11/18 20:53:08 Great stuff here Mikhail, thanks! The WM is the sa
+ } else
+ window = test_helper_->GetRootsOrderedByDisplayId()[0]
+ ->window_manager()
+ ->NewTopLevelWindow(&properties);
window->SetVisible(true);
return window;
}
« no previous file with comments | « ash/mus/test/wm_test_base.h ('k') | ash/mus/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698