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 #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 Loading... | |
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(const AppListFolderItem* folder, |
Matt Giuca
2014/11/03 23:22:00
Note: I made this static as well (unrelated, but i
| |
79 AppListItem* item) { | 79 const AppListItem* item) { |
80 return item->observers_.HasObserver(folder); | 80 return item->observers_.HasObserver(folder); |
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 Loading... | |
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 |
OLD | NEW |