| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ | 5 #ifndef UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ |
| 6 #define UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ | 6 #define UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/app_list/app_list_folder_item.h" |
| 10 #include "ui/app_list/app_list_item.h" | 11 #include "ui/app_list/app_list_item.h" |
| 11 #include "ui/app_list/app_list_model.h" | 12 #include "ui/app_list/app_list_model.h" |
| 12 | 13 |
| 13 namespace app_list { | 14 namespace app_list { |
| 14 | 15 |
| 15 namespace test { | 16 namespace test { |
| 16 | 17 |
| 17 // Extends AppListModel with helper functions for use in tests. | 18 // Extends AppListModel with helper functions for use in tests. |
| 18 class AppListTestModel : public AppListModel { | 19 class AppListTestModel : public AppListModel { |
| 19 public: | 20 public: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 41 AppListItem* AddItemToFolder(AppListItem* item, const std::string& folder_id); | 42 AppListItem* AddItemToFolder(AppListItem* item, const std::string& folder_id); |
| 42 void MoveItemToFolder(AppListItem* item, const std::string& folder_id); | 43 void MoveItemToFolder(AppListItem* item, const std::string& folder_id); |
| 43 | 44 |
| 44 // Generates a name based on |id|. | 45 // Generates a name based on |id|. |
| 45 std::string GetItemName(int id); | 46 std::string GetItemName(int id); |
| 46 | 47 |
| 47 // Populate the model with |n| items titled "Item #". | 48 // Populate the model with |n| items titled "Item #". |
| 48 void PopulateApps(int n); | 49 void PopulateApps(int n); |
| 49 | 50 |
| 50 // Creates and populate a folder with |n| test apps in it. | 51 // Creates and populate a folder with |n| test apps in it. |
| 51 void CreateAndPopulateFolderWithApps(int n); | 52 AppListFolderItem* CreateAndPopulateFolderWithApps(int n); |
| 53 |
| 54 AppListFolderItem* CreateAndAddOemFolder(const std::string& id); |
| 52 | 55 |
| 53 // Populate the model with an item titled "Item |id|". | 56 // Populate the model with an item titled "Item |id|". |
| 54 void PopulateAppWithId(int id); | 57 void PopulateAppWithId(int id); |
| 55 | 58 |
| 56 // Get a string of all apps in |model| joined with ','. | 59 // Get a string of all apps in |model| joined with ','. |
| 57 std::string GetModelContent(); | 60 std::string GetModelContent(); |
| 58 | 61 |
| 59 // Creates an item with id |id|. Caller owns the result. | 62 // Creates an item with id |id|. Caller owns the result. |
| 60 AppListTestItem* CreateItem(const std::string& id); | 63 AppListTestItem* CreateItem(const std::string& id); |
| 61 | 64 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 75 int activate_count_; | 78 int activate_count_; |
| 76 AppListItem* last_activated_; | 79 AppListItem* last_activated_; |
| 77 | 80 |
| 78 DISALLOW_COPY_AND_ASSIGN(AppListTestModel); | 81 DISALLOW_COPY_AND_ASSIGN(AppListTestModel); |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 } // namespace test | 84 } // namespace test |
| 82 } // namespace app_list | 85 } // namespace app_list |
| 83 | 86 |
| 84 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ | 87 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ |
| OLD | NEW |