OLD | NEW |
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/system/web_notification/ash_popup_alignment_delegate.h" | 5 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Make sure that the toast position on the secondary display is | 269 // Make sure that the toast position on the secondary display is |
270 // positioned correctly. | 270 // positioned correctly. |
271 EXPECT_LT(1300, for_2nd_display.GetToastOriginX(gfx::Rect(0, 0, 10, 10))); | 271 EXPECT_LT(1300, for_2nd_display.GetToastOriginX(gfx::Rect(0, 0, 10, 10))); |
272 EXPECT_LT(700, for_2nd_display.GetBaseLine()); | 272 EXPECT_LT(700, for_2nd_display.GetBaseLine()); |
273 } | 273 } |
274 | 274 |
275 TEST_F(AshPopupAlignmentDelegateTest, Unified) { | 275 TEST_F(AshPopupAlignmentDelegateTest, Unified) { |
276 if (!SupportsMultipleDisplays()) | 276 if (!SupportsMultipleDisplays()) |
277 return; | 277 return; |
278 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 278 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
279 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); | 279 display_manager->SetUnifiedDesktopEnabled(true); |
280 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); | |
281 | 280 |
282 // Reset the delegate as the primary display's shelf will be destroyed during | 281 // Reset the delegate as the primary display's shelf will be destroyed during |
283 // transition. | 282 // transition. |
284 SetAlignmentDelegate(scoped_ptr<AshPopupAlignmentDelegate>()); | 283 SetAlignmentDelegate(scoped_ptr<AshPopupAlignmentDelegate>()); |
285 | 284 |
286 UpdateDisplay("600x600,800x800"); | 285 UpdateDisplay("600x600,800x800"); |
287 SetAlignmentDelegate(make_scoped_ptr(new AshPopupAlignmentDelegate())); | 286 SetAlignmentDelegate(make_scoped_ptr(new AshPopupAlignmentDelegate())); |
288 | 287 |
289 EXPECT_GT(600, | 288 EXPECT_GT(600, |
290 alignment_delegate()->GetToastOriginX(gfx::Rect(0, 0, 10, 10))); | 289 alignment_delegate()->GetToastOriginX(gfx::Rect(0, 0, 10, 10))); |
(...skipping 12 matching lines...) Expand all Loading... |
303 SetKeyboardBounds(keyboard_bounds); | 302 SetKeyboardBounds(keyboard_bounds); |
304 int keyboard_baseline = alignment_delegate()->GetBaseLine(); | 303 int keyboard_baseline = alignment_delegate()->GetBaseLine(); |
305 EXPECT_NE(baseline, keyboard_baseline); | 304 EXPECT_NE(baseline, keyboard_baseline); |
306 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline); | 305 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline); |
307 | 306 |
308 SetKeyboardBounds(gfx::Rect()); | 307 SetKeyboardBounds(gfx::Rect()); |
309 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); | 308 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); |
310 } | 309 } |
311 | 310 |
312 } // namespace ash | 311 } // namespace ash |
OLD | NEW |