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

Unified Diff: chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc

Issue 27438002: Store AppItems as pages in AppListModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
index bfd3cdda60a51af5de8304e27c6d86b8b0b7fa3a..9d12fb3bb5f77adf2185ce823824a33c947e003c 100644
--- a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
+++ b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
@@ -32,10 +32,13 @@ const char kPackagedApp2Id[] = "jlklkagmeajbjiobondfhiekepofmljl";
// Get a string of all apps in |model| joined with ','.
std::string GetModelContent(app_list::AppListModel* model) {
std::string content;
- for (size_t i = 0; i < model->apps()->item_count(); ++i) {
- if (i > 0)
- content += ',';
- content += model->apps()->GetItemAt(i)->title();
+ for (size_t p = 0; p < model->GetNumAppPages(); ++p) {
+ const app_list::AppListModel::AppItems& apps = model->GetAppItems(p);
+ for (size_t i = 0; i < apps.item_count(); ++i) {
+ if (i > 0)
+ content += ',';
+ content += apps.GetItemAt(i)->title();
+ }
}
return content;
}
@@ -285,15 +288,15 @@ TEST_F(ExtensionAppModelBuilderTest, OrdinalConfilicts) {
TEST_F(ExtensionAppModelBuilderTest, SwitchProfile) {
ExtensionAppModelBuilder builder(profile_.get(), model_.get(), NULL);
- EXPECT_EQ(kDefaultAppCount, model_->apps()->item_count());
+ EXPECT_EQ(kDefaultAppCount, model_->GetAppItems(0).item_count());
koz (OOO until 15th September) 2013/10/18 05:17:17 GetAppItems() -> GetPage(), or similar?
stevenjb 2013/10/18 22:14:26 -> GetAppItemsForPage()
// Switch to a profile with no apps, ensure all apps are removed.
TestingProfile::Builder profile_builder;
scoped_ptr<TestingProfile> profile2(profile_builder.Build());
builder.SwitchProfile(profile2.get());
- EXPECT_EQ(0u, model_->apps()->item_count());
+ EXPECT_EQ(0u, model_->GetNumAppPages());
// Switch back to the main profile, ensure apps are restored.
builder.SwitchProfile(profile_.get());
- EXPECT_EQ(kDefaultAppCount, model_->apps()->item_count());
+ EXPECT_EQ(kDefaultAppCount, model_->GetAppItems(0).item_count());
}

Powered by Google App Engine
This is Rietveld 408576698