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

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

Issue 1154323002: Use app list item shadow for app list folders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_arrow_keys_crash
Patch Set: fix mac compile Created 5 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
« no previous file with comments | « ui/app_list/folder_image.cc ('k') | ui/app_list/test/app_list_test_model.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 5 #include <string>
6 6
7 #include "ui/app_list/folder_image.h" 7 #include "ui/app_list/folder_image.h"
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 observer_.Reset(); 68 observer_.Reset();
69 folder_image_.AddObserver(&observer_); 69 folder_image_.AddObserver(&observer_);
70 } 70 }
71 71
72 void TearDown() override { folder_image_.RemoveObserver(&observer_); } 72 void TearDown() override { folder_image_.RemoveObserver(&observer_); }
73 73
74 protected: 74 protected:
75 void AddAppWithColoredIcon(const std::string& id, SkColor icon_color) { 75 void AddAppWithColoredIcon(const std::string& id, SkColor icon_color) {
76 scoped_ptr<AppListItem> item(new AppListItem(id)); 76 scoped_ptr<AppListItem> item(new AppListItem(id));
77 item->SetIcon(CreateSquareBitmapWithColor(kListIconSize, icon_color), 77 item->SetIcon(CreateSquareBitmapWithColor(kListIconSize, icon_color));
78 false);
79 app_list_model_.AddItem(item.Pass()); 78 app_list_model_.AddItem(item.Pass());
80 } 79 }
81 80
82 AppListModel app_list_model_; 81 AppListModel app_list_model_;
83 82
84 FolderImage folder_image_; 83 FolderImage folder_image_;
85 84
86 TestFolderImageObserver observer_; 85 TestFolderImageObserver observer_;
87 86
88 private: 87 private:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 EXPECT_TRUE(observer_.updated()); 130 EXPECT_TRUE(observer_.updated());
132 observer_.Reset(); 131 observer_.Reset();
133 gfx::ImageSkia icon4 = folder_image_.icon(); 132 gfx::ImageSkia icon4 = folder_image_.icon();
134 EXPECT_FALSE(ImagesAreEqual(icon3, icon4)); 133 EXPECT_FALSE(ImagesAreEqual(icon3, icon4));
135 } 134 }
136 135
137 TEST_F(FolderImageTest, UpdateItemTest) { 136 TEST_F(FolderImageTest, UpdateItemTest) {
138 gfx::ImageSkia icon1 = folder_image_.icon(); 137 gfx::ImageSkia icon1 = folder_image_.icon();
139 138
140 // Change an item's icon. Ensure that the observer fired and the icon changed. 139 // Change an item's icon. Ensure that the observer fired and the icon changed.
141 app_list_model_.FindItem("app2")->SetIcon( 140 app_list_model_.FindItem("app2")
142 CreateSquareBitmapWithColor(kListIconSize, SK_ColorMAGENTA), false); 141 ->SetIcon(CreateSquareBitmapWithColor(kListIconSize, SK_ColorMAGENTA));
143 EXPECT_TRUE(observer_.updated()); 142 EXPECT_TRUE(observer_.updated());
144 observer_.Reset(); 143 observer_.Reset();
145 EXPECT_FALSE(ImagesAreEqual(icon1, folder_image_.icon())); 144 EXPECT_FALSE(ImagesAreEqual(icon1, folder_image_.icon()));
146 } 145 }
147 146
148 } // namespace app_list 147 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/folder_image.cc ('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