| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 test_api_.reset(new AppsGridViewTestApi(apps_grid_view_.get())); | 101 test_api_.reset(new AppsGridViewTestApi(apps_grid_view_.get())); |
| 102 } | 102 } |
| 103 void TearDown() override { | 103 void TearDown() override { |
| 104 apps_grid_view_.reset(); // Release apps grid view before models. | 104 apps_grid_view_.reset(); // Release apps grid view before models. |
| 105 views::ViewsTestBase::TearDown(); | 105 views::ViewsTestBase::TearDown(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 protected: | 108 protected: |
| 109 void EnsureFoldersEnabled() { | 109 void EnsureFoldersEnabled() { |
| 110 // Folders require AppList sync to be enabled. | 110 // Folders require AppList sync to be enabled. |
| 111 CommandLine::ForCurrentProcess()->AppendSwitch( | 111 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 112 switches::kEnableSyncAppList); | 112 switches::kEnableSyncAppList); |
| 113 } | 113 } |
| 114 | 114 |
| 115 AppListItemView* GetItemViewAt(int index) { | 115 AppListItemView* GetItemViewAt(int index) { |
| 116 return static_cast<AppListItemView*>( | 116 return static_cast<AppListItemView*>( |
| 117 test_api_->GetViewAtModelIndex(index)); | 117 test_api_->GetViewAtModelIndex(index)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 AppListItemView* GetItemViewForPoint(const gfx::Point& point) { | 120 AppListItemView* GetItemViewForPoint(const gfx::Point& point) { |
| 121 for (size_t i = 0; i < model_->top_level_item_list()->item_count(); ++i) { | 121 for (size_t i = 0; i < model_->top_level_item_list()->item_count(); ++i) { |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 AppListItemView* item_view = GetItemViewAt(0); | 782 AppListItemView* item_view = GetItemViewAt(0); |
| 783 ASSERT_TRUE(item_view); | 783 ASSERT_TRUE(item_view); |
| 784 const views::Label* title_label = item_view->title(); | 784 const views::Label* title_label = item_view->title(); |
| 785 EXPECT_FALSE(title_label->GetTooltipText( | 785 EXPECT_FALSE(title_label->GetTooltipText( |
| 786 title_label->bounds().CenterPoint(), &actual_tooltip)); | 786 title_label->bounds().CenterPoint(), &actual_tooltip)); |
| 787 EXPECT_EQ(title, base::UTF16ToUTF8(title_label->text())); | 787 EXPECT_EQ(title, base::UTF16ToUTF8(title_label->text())); |
| 788 } | 788 } |
| 789 | 789 |
| 790 } // namespace test | 790 } // namespace test |
| 791 } // namespace app_list | 791 } // namespace app_list |
| OLD | NEW |