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

Side by Side Diff: ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc

Issue 2370913002: Removes AshTestBase::SupportsHostWindowResize (Closed)
Patch Set: feedback Created 4 years, 2 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/system/toast/toast_manager_unittest.cc ('k') | ash/test/ash_test_base.h » ('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/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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 GetPrimaryShelf()->SetAlignment(SHELF_ALIGNMENT_LEFT); 119 GetPrimaryShelf()->SetAlignment(SHELF_ALIGNMENT_LEFT);
120 toast_point.set_x(alignment_delegate()->GetToastOriginX(toast_size)); 120 toast_point.set_x(alignment_delegate()->GetToastOriginX(toast_size));
121 toast_point.set_y(alignment_delegate()->GetBaseLine()); 121 toast_point.set_y(alignment_delegate()->GetBaseLine());
122 EXPECT_EQ(BOTTOM_LEFT, GetPositionInDisplay(toast_point)); 122 EXPECT_EQ(BOTTOM_LEFT, GetPositionInDisplay(toast_point));
123 EXPECT_FALSE(alignment_delegate()->IsTopDown()); 123 EXPECT_FALSE(alignment_delegate()->IsTopDown());
124 EXPECT_TRUE(alignment_delegate()->IsFromLeft()); 124 EXPECT_TRUE(alignment_delegate()->IsFromLeft());
125 } 125 }
126 126
127 TEST_F(AshPopupAlignmentDelegateTest, LockScreen) { 127 TEST_F(AshPopupAlignmentDelegateTest, LockScreen) {
128 if (!SupportsHostWindowResize())
129 return;
130
131 const gfx::Rect toast_size(0, 0, 10, 10); 128 const gfx::Rect toast_size(0, 0, 10, 10);
132 129
133 GetPrimaryShelf()->SetAlignment(SHELF_ALIGNMENT_LEFT); 130 GetPrimaryShelf()->SetAlignment(SHELF_ALIGNMENT_LEFT);
134 gfx::Point toast_point; 131 gfx::Point toast_point;
135 toast_point.set_x(alignment_delegate()->GetToastOriginX(toast_size)); 132 toast_point.set_x(alignment_delegate()->GetToastOriginX(toast_size));
136 toast_point.set_y(alignment_delegate()->GetBaseLine()); 133 toast_point.set_y(alignment_delegate()->GetBaseLine());
137 EXPECT_EQ(BOTTOM_LEFT, GetPositionInDisplay(toast_point)); 134 EXPECT_EQ(BOTTOM_LEFT, GetPositionInDisplay(toast_point));
138 EXPECT_FALSE(alignment_delegate()->IsTopDown()); 135 EXPECT_FALSE(alignment_delegate()->IsTopDown());
139 EXPECT_TRUE(alignment_delegate()->IsFromLeft()); 136 EXPECT_TRUE(alignment_delegate()->IsFromLeft());
140 137
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 shelf->SetVirtualKeyboardBoundsForTesting(keyboard_bounds); 304 shelf->SetVirtualKeyboardBoundsForTesting(keyboard_bounds);
308 int keyboard_baseline = alignment_delegate()->GetBaseLine(); 305 int keyboard_baseline = alignment_delegate()->GetBaseLine();
309 EXPECT_NE(baseline, keyboard_baseline); 306 EXPECT_NE(baseline, keyboard_baseline);
310 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline); 307 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline);
311 308
312 shelf->SetVirtualKeyboardBoundsForTesting(gfx::Rect()); 309 shelf->SetVirtualKeyboardBoundsForTesting(gfx::Rect());
313 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); 310 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine());
314 } 311 }
315 312
316 } // namespace ash 313 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/toast/toast_manager_unittest.cc ('k') | ash/test/ash_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698