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 3 // found in the LICENSE file. 4 5 #ifndef UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ 6 #define UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ 7 8 #include <string> 9 10 #include "ui/app_list/app_list_model.h" 11 12 namespace app_list { 13 14 class AppListItemModel; 15 16 namespace test { 17 18 // Extends AppListModel with helper functions for use in tests. 19 class AppListTestModel : public AppListModel { 20 public: 21 AppListTestModel() {} 22 23 // Populate the model with |n| items titled "Item #". 24 void PopulateApps(int n); 25 26 // Populate the model with an item titled "Item |id|". 27 void PopulateAppWithId(int id); 28 29 // Get a string of all apps in |model| joined with ','. 30 std::string GetModelContent(); 31 32 AppListItemModel* CreateItem(const std::string& title); 33 void AddItem(const std::string& title); 34 35 // Call SetHighlighted on the specified item. 36 void HighlightItemAt(int index); 37 38 private: 39 DISALLOW_COPY_AND_ASSIGN(AppListTestModel); 40 }; 41 42 } // namespace test 43 } // namespace app_list 44 45 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ 46