OLD | NEW |
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 "ui/app_list/views/apps_grid_view.h" | 5 #include "ui/app_list/views/apps_grid_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // testing::Test overrides: | 99 // testing::Test overrides: |
100 virtual void SetUp() OVERRIDE { | 100 virtual void SetUp() OVERRIDE { |
101 model_.reset(new AppListTestModel); | 101 model_.reset(new AppListTestModel); |
102 pagination_model_.reset(new PaginationModel); | 102 pagination_model_.reset(new PaginationModel); |
103 | 103 |
104 apps_grid_view_.reset( | 104 apps_grid_view_.reset( |
105 new AppsGridView(NULL, pagination_model_.get(), NULL)); | 105 new AppsGridView(NULL, pagination_model_.get(), NULL)); |
106 apps_grid_view_->SetLayout(kIconDimension, kCols, kRows); | 106 apps_grid_view_->SetLayout(kIconDimension, kCols, kRows); |
107 apps_grid_view_->SetBoundsRect(gfx::Rect(gfx::Size(kWidth, kHeight))); | 107 apps_grid_view_->SetBoundsRect(gfx::Rect(gfx::Size(kWidth, kHeight))); |
108 apps_grid_view_->SetModel(model_.get()); | 108 apps_grid_view_->SetModel(model_.get()); |
| 109 apps_grid_view_->SetApps(model_->apps()); |
109 | 110 |
110 test_api_.reset(new AppsGridViewTestApi(apps_grid_view_.get())); | 111 test_api_.reset(new AppsGridViewTestApi(apps_grid_view_.get())); |
111 } | 112 } |
112 virtual void TearDown() OVERRIDE { | 113 virtual void TearDown() OVERRIDE { |
113 apps_grid_view_.reset(); // Release apps grid view before models. | 114 apps_grid_view_.reset(); // Release apps grid view before models. |
114 } | 115 } |
115 | 116 |
116 protected: | 117 protected: |
117 AppListItemView* GetItemViewAt(int index) { | 118 AppListItemView* GetItemViewAt(int index) { |
118 return static_cast<AppListItemView*>( | 119 return static_cast<AppListItemView*>( |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 AppListItemView* item_view = GetItemViewAt(0); | 454 AppListItemView* item_view = GetItemViewAt(0); |
454 ASSERT_TRUE(item_view); | 455 ASSERT_TRUE(item_view); |
455 const views::Label* title_label = item_view->title(); | 456 const views::Label* title_label = item_view->title(); |
456 EXPECT_FALSE(title_label->GetTooltipText( | 457 EXPECT_FALSE(title_label->GetTooltipText( |
457 title_label->bounds().CenterPoint(), &actual_tooltip)); | 458 title_label->bounds().CenterPoint(), &actual_tooltip)); |
458 EXPECT_EQ(title, UTF16ToUTF8(title_label->text())); | 459 EXPECT_EQ(title, UTF16ToUTF8(title_label->text())); |
459 } | 460 } |
460 | 461 |
461 } // namespace test | 462 } // namespace test |
462 } // namespace app_list | 463 } // namespace app_list |
OLD | NEW |