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

Side by Side Diff: ash/system/tray/system_tray_unittest.cc

Issue 1907363004: (Merge to M-51) Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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/tray/system_tray.cc ('k') | ash/system/tray/tray_background_view.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/accessibility_delegate.h" 9 #include "ash/accessibility_delegate.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 // Test in bottom alignment. 359 // Test in bottom alignment.
360 manager->SetAlignment(SHELF_ALIGNMENT_BOTTOM); 360 manager->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
361 gfx::Rect window_bounds = widget->GetWindowBoundsInScreen(); 361 gfx::Rect window_bounds = widget->GetWindowBoundsInScreen();
362 gfx::Rect tray_bounds = tray->GetBoundsInScreen(); 362 gfx::Rect tray_bounds = tray->GetBoundsInScreen();
363 EXPECT_TRUE(window_bounds.bottom() >= tray_bounds.bottom()); 363 EXPECT_TRUE(window_bounds.bottom() >= tray_bounds.bottom());
364 EXPECT_TRUE(window_bounds.right() >= tray_bounds.right()); 364 EXPECT_TRUE(window_bounds.right() >= tray_bounds.right());
365 EXPECT_TRUE(window_bounds.x() >= tray_bounds.x()); 365 EXPECT_TRUE(window_bounds.x() >= tray_bounds.x());
366 EXPECT_TRUE(window_bounds.y() >= tray_bounds.y()); 366 EXPECT_TRUE(window_bounds.y() >= tray_bounds.y());
367 367
368 // Test in locked alignment.
369 manager->SetAlignment(SHELF_ALIGNMENT_BOTTOM_LOCKED);
370 window_bounds = widget->GetWindowBoundsInScreen();
371 tray_bounds = tray->GetBoundsInScreen();
372 EXPECT_TRUE(window_bounds.bottom() >= tray_bounds.bottom());
373 EXPECT_TRUE(window_bounds.right() >= tray_bounds.right());
374 EXPECT_TRUE(window_bounds.x() >= tray_bounds.x());
375 EXPECT_TRUE(window_bounds.y() >= tray_bounds.y());
376
368 // Test in the left alignment. 377 // Test in the left alignment.
369 manager->SetAlignment(SHELF_ALIGNMENT_LEFT); 378 manager->SetAlignment(SHELF_ALIGNMENT_LEFT);
370 window_bounds = widget->GetWindowBoundsInScreen(); 379 window_bounds = widget->GetWindowBoundsInScreen();
371 tray_bounds = tray->GetBoundsInScreen(); 380 tray_bounds = tray->GetBoundsInScreen();
372 EXPECT_TRUE(window_bounds.bottom() >= tray_bounds.bottom()); 381 EXPECT_TRUE(window_bounds.bottom() >= tray_bounds.bottom());
373 EXPECT_TRUE(window_bounds.right() >= tray_bounds.right()); 382 EXPECT_TRUE(window_bounds.right() >= tray_bounds.right());
374 EXPECT_TRUE(window_bounds.x() >= tray_bounds.x()); 383 EXPECT_TRUE(window_bounds.x() >= tray_bounds.x());
375 EXPECT_TRUE(window_bounds.y() >= tray_bounds.y()); 384 EXPECT_TRUE(window_bounds.y() >= tray_bounds.y());
376 385
377 // Test in the right alignment. 386 // Test in the right alignment.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 EXPECT_FALSE(view->active()); 544 EXPECT_FALSE(view->active());
536 545
537 generator.set_current_location(move_point); 546 generator.set_current_location(move_point);
538 generator.ReleaseTouch(); 547 generator.ReleaseTouch();
539 EXPECT_FALSE(view->active()); 548 EXPECT_FALSE(view->active());
540 } 549 }
541 #endif // OS_CHROMEOS 550 #endif // OS_CHROMEOS
542 551
543 } // namespace test 552 } // namespace test
544 } // namespace ash 553 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | ash/system/tray/tray_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698