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

Side by Side Diff: ash/wm/window_positioner_unittest.cc

Issue 62333015: Ensure that the first browser window which is created in Windows 8 ASH is maximized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/wm/window_positioner.h" 5 #include "ash/wm/window_positioner.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell/toplevel_window.h" 8 #include "ash/shell/toplevel_window.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
(...skipping 26 matching lines...) Expand all
37 UpdateDisplay("400x400,1400x900"); 37 UpdateDisplay("400x400,1400x900");
38 aura::Window* second_root_window = Shell::GetAllRootWindows()[1]; 38 aura::Window* second_root_window = Shell::GetAllRootWindows()[1];
39 Shell::GetInstance()->set_target_root_window( 39 Shell::GetInstance()->set_target_root_window(
40 second_root_window); 40 second_root_window);
41 shell::ToplevelWindow::CreateParams params; 41 shell::ToplevelWindow::CreateParams params;
42 params.can_resize = true; 42 params.can_resize = true;
43 params.can_maximize = true; 43 params.can_maximize = true;
44 views::Widget* widget = 44 views::Widget* widget =
45 shell::ToplevelWindow::CreateToplevelWindow(params); 45 shell::ToplevelWindow::CreateToplevelWindow(params);
46 gfx::Rect bounds = widget->GetWindowBoundsInScreen(); 46 gfx::Rect bounds = widget->GetWindowBoundsInScreen();
47 #if defined(OS_WIN)
48 EXPECT_TRUE(widget->IsMaximized());
49 #else
47 // The window should be in the 2nd display with the default size. 50 // The window should be in the 2nd display with the default size.
48 EXPECT_EQ("300x300", bounds.size().ToString()); 51 EXPECT_EQ("300x300", bounds.size().ToString());
52 #endif
49 EXPECT_TRUE(Shell::GetScreen()->GetDisplayNearestWindow( 53 EXPECT_TRUE(Shell::GetScreen()->GetDisplayNearestWindow(
50 second_root_window).bounds().Contains(bounds)); 54 second_root_window).bounds().Contains(bounds));
51 } 55 }
52 56
53 namespace { 57 namespace {
54 58
55 // A WidgetDelegate that returns the out of display saved bounds. 59 // A WidgetDelegate that returns the out of display saved bounds.
56 class OutOfDisplayDelegate : public views::WidgetDelegate { 60 class OutOfDisplayDelegate : public views::WidgetDelegate {
57 public: 61 public:
58 explicit OutOfDisplayDelegate(views::Widget* widget) : widget_(widget) {} 62 explicit OutOfDisplayDelegate(views::Widget* widget) : widget_(widget) {}
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 widget->Init(params); 101 widget->Init(params);
98 widget->SetBounds(gfx::Rect(450,10, 100, 100)); 102 widget->SetBounds(gfx::Rect(450,10, 100, 100));
99 wm::GetWindowState(widget->GetNativeView())->set_minimum_visibility(true); 103 wm::GetWindowState(widget->GetNativeView())->set_minimum_visibility(true);
100 widget->Show(); 104 widget->Show();
101 // Make sure the bounds is adjusted to be inside the work area. 105 // Make sure the bounds is adjusted to be inside the work area.
102 EXPECT_EQ("390,10 100x100", widget->GetWindowBoundsInScreen().ToString()); 106 EXPECT_EQ("390,10 100x100", widget->GetWindowBoundsInScreen().ToString());
103 widget->CloseNow(); 107 widget->CloseNow();
104 } 108 }
105 109
106 } // namespace 110 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698