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

Side by Side Diff: ui/app_list/app_list_model_unittest.cc

Issue 697953002: ObserverList::HasObserver now takes a const pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile errors (ChromeOS unit tests). Created 6 years, 1 month 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
« no previous file with comments | « sync/sessions/model_type_registry.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ui/app_list/app_list_model.h" 5 #include "ui/app_list/app_list_model.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 class AppListModelTest : public testing::Test { 68 class AppListModelTest : public testing::Test {
69 public: 69 public:
70 AppListModelTest() {} 70 AppListModelTest() {}
71 ~AppListModelTest() override {} 71 ~AppListModelTest() override {}
72 72
73 // testing::Test overrides: 73 // testing::Test overrides:
74 void SetUp() override { model_.AddObserver(&observer_); } 74 void SetUp() override { model_.AddObserver(&observer_); }
75 void TearDown() override { model_.RemoveObserver(&observer_); } 75 void TearDown() override { model_.RemoveObserver(&observer_); }
76 76
77 protected: 77 protected:
78 bool ItemObservedByFolder(AppListFolderItem* folder, 78 static bool ItemObservedByFolder(AppListFolderItem* folder,
79 AppListItem* item) { 79 const AppListItem* item) {
80 return item->observers_.HasObserver(folder->folder_image()); 80 return item->observers_.HasObserver(folder->folder_image());
81 } 81 }
82 82
83 std::string GetItemListContents(AppListItemList* item_list) { 83 std::string GetItemListContents(AppListItemList* item_list) {
84 std::string s; 84 std::string s;
85 for (size_t i = 0; i < item_list->item_count(); ++i) { 85 for (size_t i = 0; i < item_list->item_count(); ++i) {
86 if (i != 0) 86 if (i != 0)
87 s += ","; 87 s += ",";
88 s += item_list->item_at(i)->id(); 88 s += item_list->item_at(i)->id();
89 } 89 }
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 model_.SetFoldersEnabled(false); 500 model_.SetFoldersEnabled(false);
501 ASSERT_FALSE(model_.FindFolderItem(folder_id)); 501 ASSERT_FALSE(model_.FindFolderItem(folder_id));
502 ASSERT_TRUE(model_.FindFolderItem(oem_folder_id)); 502 ASSERT_TRUE(model_.FindFolderItem(oem_folder_id));
503 EXPECT_EQ("Item 0,Item 1,oem_folder", GetModelContents()); 503 EXPECT_EQ("Item 0,Item 1,oem_folder", GetModelContents());
504 504
505 // Ensure folder creation fails. 505 // Ensure folder creation fails.
506 EXPECT_EQ(std::string(), model_.MergeItems(item0->id(), item1->id())); 506 EXPECT_EQ(std::string(), model_.MergeItems(item0->id(), item1->id()));
507 } 507 }
508 508
509 } // namespace app_list 509 } // namespace app_list
OLDNEW
« no previous file with comments | « sync/sessions/model_type_registry.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698