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

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

Issue 1135323002: Revert of Have Notifications appear over docked windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/system/web_notification/ash_popup_alignment_delegate.cc ('k') | no next file » | 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/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/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 int origin_x = alignment_delegate()->GetToastOriginX(toast_size); 163 int origin_x = alignment_delegate()->GetToastOriginX(toast_size);
164 int baseline = alignment_delegate()->GetBaseLine(); 164 int baseline = alignment_delegate()->GetBaseLine();
165 165
166 scoped_ptr<aura::Window> window( 166 scoped_ptr<aura::Window> window(
167 CreateTestWindowInShellWithBounds(gfx::Rect(0, 0, 50, 50))); 167 CreateTestWindowInShellWithBounds(gfx::Rect(0, 0, 50, 50)));
168 aura::Window* docked_container = Shell::GetContainer( 168 aura::Window* docked_container = Shell::GetContainer(
169 Shell::GetPrimaryRootWindow(), 169 Shell::GetPrimaryRootWindow(),
170 kShellWindowId_DockedContainer); 170 kShellWindowId_DockedContainer);
171 docked_container->AddChild(window.get()); 171 docked_container->AddChild(window.get());
172 172
173 // Left-side dock should not affect popup alignment
174 EXPECT_EQ(origin_x, alignment_delegate()->GetToastOriginX(toast_size)); 173 EXPECT_EQ(origin_x, alignment_delegate()->GetToastOriginX(toast_size));
175 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); 174 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine());
176 EXPECT_FALSE(alignment_delegate()->IsTopDown()); 175 EXPECT_FALSE(alignment_delegate()->IsTopDown());
177 EXPECT_FALSE(alignment_delegate()->IsFromLeft());
178
179 // Force dock to right-side
180 Shell::GetInstance()->SetShelfAlignment(SHELF_ALIGNMENT_LEFT,
181 Shell::GetPrimaryRootWindow());
182 Shell::GetInstance()->SetShelfAlignment(SHELF_ALIGNMENT_BOTTOM,
183 Shell::GetPrimaryRootWindow());
184
185 // Right-side dock should not affect popup alignment
186 EXPECT_EQ(origin_x, alignment_delegate()->GetToastOriginX(toast_size));
187 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine());
188 EXPECT_FALSE(alignment_delegate()->IsTopDown());
189 EXPECT_FALSE(alignment_delegate()->IsFromLeft()); 176 EXPECT_FALSE(alignment_delegate()->IsFromLeft());
190 } 177 }
191 178
192 TEST_F(AshPopupAlignmentDelegateTest, DisplayResize) { 179 TEST_F(AshPopupAlignmentDelegateTest, DisplayResize) {
193 const gfx::Rect toast_size(0, 0, 10, 10); 180 const gfx::Rect toast_size(0, 0, 10, 10);
194 UpdateDisplay("600x600"); 181 UpdateDisplay("600x600");
195 int origin_x = alignment_delegate()->GetToastOriginX(toast_size); 182 int origin_x = alignment_delegate()->GetToastOriginX(toast_size);
196 int baseline = alignment_delegate()->GetBaseLine(); 183 int baseline = alignment_delegate()->GetBaseLine();
197 184
198 UpdateDisplay("800x800"); 185 UpdateDisplay("800x800");
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 SetAlignmentDelegate(scoped_ptr<AshPopupAlignmentDelegate>()); 240 SetAlignmentDelegate(scoped_ptr<AshPopupAlignmentDelegate>());
254 241
255 UpdateDisplay("600x600,800x800"); 242 UpdateDisplay("600x600,800x800");
256 SetAlignmentDelegate(make_scoped_ptr(new AshPopupAlignmentDelegate())); 243 SetAlignmentDelegate(make_scoped_ptr(new AshPopupAlignmentDelegate()));
257 244
258 EXPECT_GT(600, 245 EXPECT_GT(600,
259 alignment_delegate()->GetToastOriginX(gfx::Rect(0, 0, 10, 10))); 246 alignment_delegate()->GetToastOriginX(gfx::Rect(0, 0, 10, 10)));
260 } 247 }
261 248
262 } // namespace ash 249 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/web_notification/ash_popup_alignment_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698