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

Side by Side Diff: ash/launcher/launcher_view_unittest.cc

Issue 14640019: Regression issue with "ShouldHop" (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rm invalid unit test Created 7 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/launcher/launcher_button.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 (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/launcher/launcher_view.h" 5 #include "ash/launcher/launcher_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/launcher/launcher.h" 10 #include "ash/launcher/launcher.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 370
371 LauncherModel* model_; 371 LauncherModel* model_;
372 internal::LauncherView* launcher_view_; 372 internal::LauncherView* launcher_view_;
373 373
374 scoped_ptr<LauncherViewTestAPI> test_api_; 374 scoped_ptr<LauncherViewTestAPI> test_api_;
375 375
376 private: 376 private:
377 DISALLOW_COPY_AND_ASSIGN(LauncherViewTest); 377 DISALLOW_COPY_AND_ASSIGN(LauncherViewTest);
378 }; 378 };
379 379
380 // Checks that the icon positions do not shift with a state change.
381 TEST_F(LauncherViewTest, NoStateChangeIconMovement) {
382 LauncherID last_added = AddAppShortcut();
383 internal::LauncherButton* button = GetButtonByID(last_added);
384 EXPECT_EQ(button->state(), ash::internal::LauncherButton::STATE_NORMAL);
385 gfx::Rect old_bounds = button->GetIconBounds();
386
387 button->AddState(ash::internal::LauncherButton::STATE_HOVERED);
388 gfx::Rect hovered_bounds = button->GetIconBounds();
389 EXPECT_EQ(old_bounds.ToString(), hovered_bounds.ToString());
390 }
391
392 // Adds browser button until overflow and verifies that the last added browser 380 // Adds browser button until overflow and verifies that the last added browser
393 // button is hidden. 381 // button is hidden.
394 TEST_F(LauncherViewTest, AddBrowserUntilOverflow) { 382 TEST_F(LauncherViewTest, AddBrowserUntilOverflow) {
395 // All buttons should be visible. 383 // All buttons should be visible.
396 ASSERT_EQ(test_api_->GetLastVisibleIndex() + 1, 384 ASSERT_EQ(test_api_->GetLastVisibleIndex() + 1,
397 test_api_->GetButtonCount()); 385 test_api_->GetButtonCount());
398 386
399 // Add tabbed browser until overflow. 387 // Add tabbed browser until overflow.
400 int items_added = 0; 388 int items_added = 0;
401 LauncherID last_added = AddTabbedBrowser(); 389 LauncherID last_added = AddTabbedBrowser();
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 // All buttons should be visible. 894 // All buttons should be visible.
907 ASSERT_EQ(test_api_->GetLastVisibleIndex() + 1, 895 ASSERT_EQ(test_api_->GetLastVisibleIndex() + 1,
908 test_api_->GetButtonCount()); 896 test_api_->GetButtonCount());
909 gfx::Rect ideal_bounds_0 = test_api_->GetIdealBoundsByIndex(0); 897 gfx::Rect ideal_bounds_0 = test_api_->GetIdealBoundsByIndex(0);
910 gfx::Rect ideal_bounds_1 = test_api_->GetIdealBoundsByIndex(1); 898 gfx::Rect ideal_bounds_1 = test_api_->GetIdealBoundsByIndex(1);
911 EXPECT_GT(ideal_bounds_0.width(), ideal_bounds_1.width()); 899 EXPECT_GT(ideal_bounds_0.width(), ideal_bounds_1.width());
912 } 900 }
913 901
914 } // namespace test 902 } // namespace test
915 } // namespace ash 903 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698