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/common/system/web_notification/ash_popup_alignment_delegate.h" | 5 #include "ash/common/system/web_notification/ash_popup_alignment_delegate.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/shelf/shelf_types.h" | 10 #include "ash/common/shelf/shelf_types.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 const gfx::Rect toast_size(0, 0, 10, 10); | 217 const gfx::Rect toast_size(0, 0, 10, 10); |
218 UpdateDisplay("600x600"); | 218 UpdateDisplay("600x600"); |
219 int origin_x = alignment_delegate()->GetToastOriginX(toast_size); | 219 int origin_x = alignment_delegate()->GetToastOriginX(toast_size); |
220 int baseline = alignment_delegate()->GetBaseLine(); | 220 int baseline = alignment_delegate()->GetBaseLine(); |
221 | 221 |
222 // Emulate the docked mode; enter to an extended mode, then invoke | 222 // Emulate the docked mode; enter to an extended mode, then invoke |
223 // OnNativeDisplaysChanged() with the info for the secondary display only. | 223 // OnNativeDisplaysChanged() with the info for the secondary display only. |
224 UpdateDisplay("600x600,800x800"); | 224 UpdateDisplay("600x600,800x800"); |
225 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 225 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
226 | 226 |
227 std::vector<DisplayInfo> new_info; | 227 std::vector<display::ManagedDisplayInfo> new_info; |
228 new_info.push_back( | 228 new_info.push_back( |
229 display_manager->GetDisplayInfo(display_manager->GetDisplayAt(1u).id())); | 229 display_manager->GetDisplayInfo(display_manager->GetDisplayAt(1u).id())); |
230 display_manager->OnNativeDisplaysChanged(new_info); | 230 display_manager->OnNativeDisplaysChanged(new_info); |
231 | 231 |
232 EXPECT_LT(origin_x, alignment_delegate()->GetToastOriginX(toast_size)); | 232 EXPECT_LT(origin_x, alignment_delegate()->GetToastOriginX(toast_size)); |
233 EXPECT_LT(baseline, alignment_delegate()->GetBaseLine()); | 233 EXPECT_LT(baseline, alignment_delegate()->GetBaseLine()); |
234 } | 234 } |
235 | 235 |
236 TEST_F(AshPopupAlignmentDelegateTest, TrayHeight) { | 236 TEST_F(AshPopupAlignmentDelegateTest, TrayHeight) { |
237 const gfx::Rect toast_size(0, 0, 10, 10); | 237 const gfx::Rect toast_size(0, 0, 10, 10); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 shelf->SetVirtualKeyboardBoundsForTesting(keyboard_bounds); | 307 shelf->SetVirtualKeyboardBoundsForTesting(keyboard_bounds); |
308 int keyboard_baseline = alignment_delegate()->GetBaseLine(); | 308 int keyboard_baseline = alignment_delegate()->GetBaseLine(); |
309 EXPECT_NE(baseline, keyboard_baseline); | 309 EXPECT_NE(baseline, keyboard_baseline); |
310 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline); | 310 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline); |
311 | 311 |
312 shelf->SetVirtualKeyboardBoundsForTesting(gfx::Rect()); | 312 shelf->SetVirtualKeyboardBoundsForTesting(gfx::Rect()); |
313 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); | 313 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); |
314 } | 314 } |
315 | 315 |
316 } // namespace ash | 316 } // namespace ash |
OLD | NEW |