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

Side by Side Diff: ash/screen_util_unittest.cc

Issue 1150913002: Save and restore unified mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix leak Created 5 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 unified diff | Download patch
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/screen_util.h" 5 #include "ash/screen_util.h"
6 6
7 #include "ash/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_widget.h" 10 #include "ash/shelf/shelf_widget.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/test/ash_test_base.h" 12 #include "ash/test/ash_test_base.h"
13 #include "ash/test/display_manager_test_api.h"
13 #include "ash/wm/window_util.h" 14 #include "ash/wm/window_util.h"
14 #include "ui/aura/env.h" 15 #include "ui/aura/env.h"
15 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
16 #include "ui/aura/window_event_dispatcher.h" 17 #include "ui/aura/window_event_dispatcher.h"
17 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
18 #include "ui/views/widget/widget_delegate.h" 19 #include "ui/views/widget/widget_delegate.h"
19 20
20 namespace ash { 21 namespace ash {
21 namespace test { 22 namespace test {
22 23
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString()); 110 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString());
110 EXPECT_EQ( 111 EXPECT_EQ(
111 "650,50 100x100", 112 "650,50 100x100",
112 ScreenUtil::ConvertRectToScreen( 113 ScreenUtil::ConvertRectToScreen(
113 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString()); 114 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString());
114 } 115 }
115 116
116 TEST_F(ScreenUtilTest, ShelfDisplayBoundsInUnifiedDesktop) { 117 TEST_F(ScreenUtilTest, ShelfDisplayBoundsInUnifiedDesktop) {
117 if (!SupportsMultipleDisplays()) 118 if (!SupportsMultipleDisplays())
118 return; 119 return;
120 test::DisplayManagerTestApi::EnableUnifiedDesktopForTest();
121
119 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 122 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
120 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); 123 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
121 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); 124 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED);
122 125
123 views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds( 126 views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
124 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100)); 127 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100));
125 128
126 UpdateDisplay("500x400"); 129 UpdateDisplay("500x400");
127 EXPECT_EQ("0,0 500x400", ScreenUtil::GetShelfDisplayBoundsInScreen( 130 EXPECT_EQ("0,0 500x400", ScreenUtil::GetShelfDisplayBoundsInScreen(
128 widget->GetNativeWindow()).ToString()); 131 widget->GetNativeWindow()).ToString());
(...skipping 10 matching lines...) Expand all
139 EXPECT_EQ("0,0 500x400", ScreenUtil::GetShelfDisplayBoundsInScreen( 142 EXPECT_EQ("0,0 500x400", ScreenUtil::GetShelfDisplayBoundsInScreen(
140 widget->GetNativeWindow()).ToString()); 143 widget->GetNativeWindow()).ToString());
141 144
142 UpdateDisplay("600x500"); 145 UpdateDisplay("600x500");
143 EXPECT_EQ("0,0 600x500", ScreenUtil::GetShelfDisplayBoundsInScreen( 146 EXPECT_EQ("0,0 600x500", ScreenUtil::GetShelfDisplayBoundsInScreen(
144 widget->GetNativeWindow()).ToString()); 147 widget->GetNativeWindow()).ToString());
145 } 148 }
146 149
147 } // namespace test 150 } // namespace test
148 } // namespace ash 151 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698