Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: ui/app_list/test/app_list_test_model.h

Issue 298963004: app_list: Fix possible out of bounds index. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK -> CHECK Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_folder_item.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 std::string GetItemName(int id); 46 std::string GetItemName(int id);
47 47
48 // Populate the model with |n| items titled "Item #". 48 // Populate the model with |n| items titled "Item #".
49 void PopulateApps(int n); 49 void PopulateApps(int n);
50 50
51 // Creates and populate a folder with |n| test apps in it. 51 // Creates and populate a folder with |n| test apps in it.
52 AppListFolderItem* CreateAndPopulateFolderWithApps(int n); 52 AppListFolderItem* CreateAndPopulateFolderWithApps(int n);
53 53
54 AppListFolderItem* CreateAndAddOemFolder(const std::string& id); 54 AppListFolderItem* CreateAndAddOemFolder(const std::string& id);
55 55
56 AppListFolderItem* CreateSingleItemFolder(const std::string& folder_id,
57 const std::string& item_id);
58
56 // Populate the model with an item titled "Item |id|". 59 // Populate the model with an item titled "Item |id|".
57 void PopulateAppWithId(int id); 60 void PopulateAppWithId(int id);
58 61
59 // Get a string of all apps in |model| joined with ','. 62 // Get a string of all apps in |model| joined with ','.
60 std::string GetModelContent(); 63 std::string GetModelContent();
61 64
62 // Creates an item with id |id|. Caller owns the result. 65 // Creates an item with id |id|. Caller owns the result.
63 AppListTestItem* CreateItem(const std::string& id); 66 AppListTestItem* CreateItem(const std::string& id);
64 67
65 // Creates and adds an item with id |id| to the model. Returns an unowned 68 // Creates and adds an item with id |id| to the model. Returns an unowned
(...skipping 12 matching lines...) Expand all
78 int activate_count_; 81 int activate_count_;
79 AppListItem* last_activated_; 82 AppListItem* last_activated_;
80 83
81 DISALLOW_COPY_AND_ASSIGN(AppListTestModel); 84 DISALLOW_COPY_AND_ASSIGN(AppListTestModel);
82 }; 85 };
83 86
84 } // namespace test 87 } // namespace test
85 } // namespace app_list 88 } // namespace app_list
86 89
87 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_ 90 #endif // UI_APP_LIST_TEST_APP_LIST_TEST_MODEL_H_
OLDNEW
« no previous file with comments | « ui/app_list/cocoa/apps_grid_controller_unittest.mm ('k') | ui/app_list/test/app_list_test_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698