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

Side by Side Diff: ash/display/display_manager_unittest.cc

Issue 2617733002: Hide docked windows behind a flag (Closed)
Patch Set: Fix tests failed because of DCHECK Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/display/manager/display_manager.h" 5 #include "ui/display/manager/display_manager.h"
6 6
7 #include "ash/accelerators/accelerator_commands_aura.h" 7 #include "ash/accelerators/accelerator_commands_aura.h"
8 #include "ash/common/ash_switches.h"
8 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
10 #include "ash/display/display_configuration_controller.h" 11 #include "ash/display/display_configuration_controller.h"
11 #include "ash/display/display_util.h" 12 #include "ash/display/display_util.h"
12 #include "ash/display/mirror_window_controller.h" 13 #include "ash/display/mirror_window_controller.h"
13 #include "ash/display/window_tree_host_manager.h" 14 #include "ash/display/window_tree_host_manager.h"
14 #include "ash/screen_util.h" 15 #include "ash/screen_util.h"
15 #include "ash/shell.h" 16 #include "ash/shell.h"
16 #include "ash/test/ash_md_test_base.h" 17 #include "ash/test/ash_md_test_base.h"
17 #include "ash/test/ash_test_base.h" 18 #include "ash/test/ash_test_base.h"
(...skipping 2247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 2266
2266 UpdateDisplay("400x500"); 2267 UpdateDisplay("400x500");
2267 EXPECT_EQ("400x500", screen->GetPrimaryDisplay().size().ToString()); 2268 EXPECT_EQ("400x500", screen->GetPrimaryDisplay().size().ToString());
2268 } 2269 }
2269 2270
2270 // Makes sure the transition from unified to single won't crash 2271 // Makes sure the transition from unified to single won't crash
2271 // with docked windows. 2272 // with docked windows.
2272 TEST_P(DisplayManagerTest, UnifiedWithDockWindows) { 2273 TEST_P(DisplayManagerTest, UnifiedWithDockWindows) {
2273 if (!SupportsMultipleDisplays()) 2274 if (!SupportsMultipleDisplays())
2274 return; 2275 return;
2276
2277 // Enable window docking for this test.
2278 base::CommandLine::ForCurrentProcess()->AppendSwitch(
2279 ash::switches::kAshEnableDockedWindows);
2280
2275 const int height_offset = GetMdMaximizedWindowHeightOffset(); 2281 const int height_offset = GetMdMaximizedWindowHeightOffset();
2276 display_manager()->SetUnifiedDesktopEnabled(true); 2282 display_manager()->SetUnifiedDesktopEnabled(true);
2277 2283
2278 // Don't check root window destruction in unified mode. 2284 // Don't check root window destruction in unified mode.
2279 Shell::GetPrimaryRootWindow()->RemoveObserver(this); 2285 Shell::GetPrimaryRootWindow()->RemoveObserver(this);
2280 2286
2281 UpdateDisplay("400x500,300x200"); 2287 UpdateDisplay("400x500,300x200");
2282 2288
2283 std::unique_ptr<aura::Window> docked( 2289 std::unique_ptr<aura::Window> docked(
2284 CreateTestWindowInShellWithBounds(gfx::Rect(10, 10, 50, 50))); 2290 CreateTestWindowInShellWithBounds(gfx::Rect(10, 10, 50, 50)));
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2557 const display::DisplayLayout& stored = 2563 const display::DisplayLayout& stored =
2558 layout_store->GetRegisteredDisplayLayout(list); 2564 layout_store->GetRegisteredDisplayLayout(list);
2559 2565
2560 EXPECT_EQ(id1, stored.placement_list[0].parent_display_id); 2566 EXPECT_EQ(id1, stored.placement_list[0].parent_display_id);
2561 EXPECT_EQ(id2, stored.placement_list[0].display_id); 2567 EXPECT_EQ(id2, stored.placement_list[0].display_id);
2562 } 2568 }
2563 2569
2564 #endif // OS_CHROMEOS 2570 #endif // OS_CHROMEOS
2565 2571
2566 } // namespace ash 2572 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698