| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "ui/app_list/app_list_constants.h" | 20 #include "ui/app_list/app_list_constants.h" |
| 21 #include "ui/app_list/app_list_folder_item.h" | 21 #include "ui/app_list/app_list_folder_item.h" |
| 22 #include "ui/app_list/app_list_item.h" | 22 #include "ui/app_list/app_list_item.h" |
| 23 #include "ui/app_list/app_list_model.h" | 23 #include "ui/app_list/app_list_model.h" |
| 24 #include "ui/app_list/app_list_switches.h" | 24 #include "ui/app_list/app_list_switches.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 ui::EventTimeForNow(), 0, 0); | 166 ui::EventTimeForNow(), 0, 0); |
| 167 apps_grid_view_->UpdateDragFromItem(pointer, drag_event); | 167 apps_grid_view_->UpdateDragFromItem(pointer, drag_event); |
| 168 return view; | 168 return view; |
| 169 } | 169 } |
| 170 | 170 |
| 171 void SimulateKeyPress(ui::KeyboardCode key_code) { | 171 void SimulateKeyPress(ui::KeyboardCode key_code) { |
| 172 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, key_code, ui::EF_NONE); | 172 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, key_code, ui::EF_NONE); |
| 173 apps_grid_view_->OnKeyPressed(key_event); | 173 apps_grid_view_->OnKeyPressed(key_event); |
| 174 } | 174 } |
| 175 | 175 |
| 176 scoped_ptr<AppListTestModel> model_; | 176 std::unique_ptr<AppListTestModel> model_; |
| 177 scoped_ptr<AppsGridView> apps_grid_view_; | 177 std::unique_ptr<AppsGridView> apps_grid_view_; |
| 178 scoped_ptr<AppsGridViewTestApi> test_api_; | 178 std::unique_ptr<AppsGridViewTestApi> test_api_; |
| 179 | 179 |
| 180 private: | 180 private: |
| 181 DISALLOW_COPY_AND_ASSIGN(AppsGridViewTest); | 181 DISALLOW_COPY_AND_ASSIGN(AppsGridViewTest); |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 class TestAppsGridViewFolderDelegate : public AppsGridViewFolderDelegate { | 184 class TestAppsGridViewFolderDelegate : public AppsGridViewFolderDelegate { |
| 185 public: | 185 public: |
| 186 TestAppsGridViewFolderDelegate() : show_bubble_(false) {} | 186 TestAppsGridViewFolderDelegate() : show_bubble_(false) {} |
| 187 ~TestAppsGridViewFolderDelegate() override {} | 187 ~TestAppsGridViewFolderDelegate() override {} |
| 188 | 188 |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 AppListItemView* item_view = GetItemViewAt(0); | 787 AppListItemView* item_view = GetItemViewAt(0); |
| 788 ASSERT_TRUE(item_view); | 788 ASSERT_TRUE(item_view); |
| 789 const views::Label* title_label = item_view->title(); | 789 const views::Label* title_label = item_view->title(); |
| 790 EXPECT_FALSE(title_label->GetTooltipText( | 790 EXPECT_FALSE(title_label->GetTooltipText( |
| 791 title_label->bounds().CenterPoint(), &actual_tooltip)); | 791 title_label->bounds().CenterPoint(), &actual_tooltip)); |
| 792 EXPECT_EQ(title, base::UTF16ToUTF8(title_label->text())); | 792 EXPECT_EQ(title, base::UTF16ToUTF8(title_label->text())); |
| 793 } | 793 } |
| 794 | 794 |
| 795 } // namespace test | 795 } // namespace test |
| 796 } // namespace app_list | 796 } // namespace app_list |
| OLD | NEW |