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

Side by Side Diff: ash/shelf/shelf_view_unittest.cc

Issue 1742953002: Simplify ash shelf layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore ConvertRectToScreen calls. Created 4 years, 9 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/shelf/shelf_view.cc ('k') | ash/shelf/shelf_widget.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/shelf/shelf_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); 218 shelf_view_test()->RunMessageLoopUntilAnimationsDone();
219 EXPECT_TRUE(observer()->change_notified()); 219 EXPECT_TRUE(observer()->change_notified());
220 EXPECT_TRUE(second_observer.change_notified()); 220 EXPECT_TRUE(second_observer.change_notified());
221 221
222 observer()->Reset(); 222 observer()->Reset();
223 second_observer.Reset(); 223 second_observer.Reset();
224 } 224 }
225 225
226 TEST_F(ShelfViewIconObserverTest, BoundsChanged) { 226 TEST_F(ShelfViewIconObserverTest, BoundsChanged) {
227 ShelfWidget* widget = Shell::GetPrimaryRootWindowController()->shelf(); 227 ShelfWidget* widget = Shell::GetPrimaryRootWindowController()->shelf();
228 Shelf* shelf = Shelf::ForPrimaryDisplay(); 228 gfx::Rect shelf_bounds = widget->GetWindowBoundsInScreen();
229 gfx::Size shelf_size = widget->GetWindowBoundsInScreen().size(); 229 shelf_bounds.set_width(shelf_bounds.width() / 2);
230 shelf_size.set_width(shelf_size.width() / 2); 230 ASSERT_GT(shelf_bounds.width(), 0);
231 ASSERT_GT(shelf_size.width(), 0); 231 widget->SetBounds(shelf_bounds);
232 shelf->SetShelfViewBounds(gfx::Rect(shelf_size));
233 // No animation happens for ShelfView bounds change. 232 // No animation happens for ShelfView bounds change.
234 EXPECT_TRUE(observer()->change_notified()); 233 EXPECT_TRUE(observer()->change_notified());
235 observer()->Reset(); 234 observer()->Reset();
236 } 235 }
237 236
238 //////////////////////////////////////////////////////////////////////////////// 237 ////////////////////////////////////////////////////////////////////////////////
239 // ShelfView tests. 238 // ShelfView tests.
240 239
241 // A ShelfDelegate test double that will always convert between ShelfIDs and app 240 // A ShelfDelegate test double that will always convert between ShelfIDs and app
242 // ids. This does not support pinning and unpinning operations and the return 241 // ids. This does not support pinning and unpinning operations and the return
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 test_api_->RunMessageLoopUntilAnimationsDone(); 1957 test_api_->RunMessageLoopUntilAnimationsDone();
1959 CheckAllItemsAreInBounds(); 1958 CheckAllItemsAreInBounds();
1960 } 1959 }
1961 1960
1962 INSTANTIATE_TEST_CASE_P(LtrRtl, ShelfViewTextDirectionTest, testing::Bool()); 1961 INSTANTIATE_TEST_CASE_P(LtrRtl, ShelfViewTextDirectionTest, testing::Bool());
1963 INSTANTIATE_TEST_CASE_P(VisibleBounds, ShelfViewVisibleBoundsTest, 1962 INSTANTIATE_TEST_CASE_P(VisibleBounds, ShelfViewVisibleBoundsTest,
1964 testing::Bool()); 1963 testing::Bool());
1965 1964
1966 } // namespace test 1965 } // namespace test
1967 } // namespace ash 1966 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698