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

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

Issue 1261693004: Allow dynamic enabling/disabling of unified desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/chromeos/tray_display_unittest.cc ('k') | ash/test/display_manager_test_api.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/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
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
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
OLDNEW
« no previous file with comments | « ash/system/chromeos/tray_display_unittest.cc ('k') | ash/test/display_manager_test_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698