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

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

Issue 1539583003: Convert Pass()→std::move() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/app_list_model.cc ('k') | ui/app_list/search/dictionary_data_store.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 "ui/app_list/folder_image.h"
6
5 #include <string> 7 #include <string>
6 8 #include <utility>
7 #include "ui/app_list/folder_image.h"
8 9
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 #include "third_party/skia/include/core/SkBitmap.h" 12 #include "third_party/skia/include/core/SkBitmap.h"
12 #include "third_party/skia/include/core/SkColor.h" 13 #include "third_party/skia/include/core/SkColor.h"
13 #include "ui/app_list/app_list_constants.h" 14 #include "ui/app_list/app_list_constants.h"
14 #include "ui/app_list/app_list_item.h" 15 #include "ui/app_list/app_list_item.h"
15 #include "ui/app_list/app_list_item_list.h" 16 #include "ui/app_list/app_list_item_list.h"
16 #include "ui/app_list/app_list_model.h" 17 #include "ui/app_list/app_list_model.h"
17 #include "ui/gfx/skia_util.h" 18 #include "ui/gfx/skia_util.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 observer_.Reset(); 69 observer_.Reset();
69 folder_image_.AddObserver(&observer_); 70 folder_image_.AddObserver(&observer_);
70 } 71 }
71 72
72 void TearDown() override { folder_image_.RemoveObserver(&observer_); } 73 void TearDown() override { folder_image_.RemoveObserver(&observer_); }
73 74
74 protected: 75 protected:
75 void AddAppWithColoredIcon(const std::string& id, SkColor icon_color) { 76 void AddAppWithColoredIcon(const std::string& id, SkColor icon_color) {
76 scoped_ptr<AppListItem> item(new AppListItem(id)); 77 scoped_ptr<AppListItem> item(new AppListItem(id));
77 item->SetIcon(CreateSquareBitmapWithColor(kListIconSize, icon_color)); 78 item->SetIcon(CreateSquareBitmapWithColor(kListIconSize, icon_color));
78 app_list_model_.AddItem(item.Pass()); 79 app_list_model_.AddItem(std::move(item));
79 } 80 }
80 81
81 AppListModel app_list_model_; 82 AppListModel app_list_model_;
82 83
83 FolderImage folder_image_; 84 FolderImage folder_image_;
84 85
85 TestFolderImageObserver observer_; 86 TestFolderImageObserver observer_;
86 87
87 private: 88 private:
88 DISALLOW_COPY_AND_ASSIGN(FolderImageTest); 89 DISALLOW_COPY_AND_ASSIGN(FolderImageTest);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 139
139 // Change an item's icon. Ensure that the observer fired and the icon changed. 140 // Change an item's icon. Ensure that the observer fired and the icon changed.
140 app_list_model_.FindItem("app2") 141 app_list_model_.FindItem("app2")
141 ->SetIcon(CreateSquareBitmapWithColor(kListIconSize, SK_ColorMAGENTA)); 142 ->SetIcon(CreateSquareBitmapWithColor(kListIconSize, SK_ColorMAGENTA));
142 EXPECT_TRUE(observer_.updated()); 143 EXPECT_TRUE(observer_.updated());
143 observer_.Reset(); 144 observer_.Reset();
144 EXPECT_FALSE(ImagesAreEqual(icon1, folder_image_.icon())); 145 EXPECT_FALSE(ImagesAreEqual(icon1, folder_image_.icon()));
145 } 146 }
146 147
147 } // namespace app_list 148 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/app_list_model.cc ('k') | ui/app_list/search/dictionary_data_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698