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

Side by Side Diff: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_utils.cc

Issue 2318023002: //chrome/browser/chromeos: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Address comment and also remove non-trivial cases Created 4 years, 3 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
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 "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_u tils.h" 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_u tils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void WaitAsyncWallpaperLoadFinished() { 162 void WaitAsyncWallpaperLoadFinished() {
163 TestWallpaperObserverPendingListEmpty observer(WallpaperManager::Get()); 163 TestWallpaperObserverPendingListEmpty observer(WallpaperManager::Get());
164 observer.WaitForPendingListEmpty(); 164 observer.WaitForPendingListEmpty();
165 } 165 }
166 166
167 void CreateCmdlineWallpapers(const base::ScopedTempDir& dir, 167 void CreateCmdlineWallpapers(const base::ScopedTempDir& dir,
168 std::unique_ptr<base::CommandLine>* command_line) { 168 std::unique_ptr<base::CommandLine>* command_line) {
169 std::vector<std::string> options; 169 std::vector<std::string> options;
170 options.push_back(std::string("WM_Test_cmdline")); 170 options.push_back(std::string("WM_Test_cmdline"));
171 const base::FilePath small_file = 171 const base::FilePath small_file =
172 dir.path().Append(FILE_PATH_LITERAL("small.jpg")); 172 dir.GetPath().Append(FILE_PATH_LITERAL("small.jpg"));
173 options.push_back(std::string("--") + 173 options.push_back(std::string("--") +
174 chromeos::switches::kDefaultWallpaperSmall + "=" + 174 chromeos::switches::kDefaultWallpaperSmall + "=" +
175 small_file.value()); 175 small_file.value());
176 const base::FilePath large_file = 176 const base::FilePath large_file =
177 dir.path().Append(FILE_PATH_LITERAL("large.jpg")); 177 dir.GetPath().Append(FILE_PATH_LITERAL("large.jpg"));
178 options.push_back(std::string("--") + 178 options.push_back(std::string("--") +
179 chromeos::switches::kDefaultWallpaperLarge + "=" + 179 chromeos::switches::kDefaultWallpaperLarge + "=" +
180 large_file.value()); 180 large_file.value());
181 181
182 const base::FilePath guest_small_file = 182 const base::FilePath guest_small_file =
183 dir.path().Append(FILE_PATH_LITERAL("guest_small.jpg")); 183 dir.GetPath().Append(FILE_PATH_LITERAL("guest_small.jpg"));
184 options.push_back(std::string("--") + 184 options.push_back(std::string("--") +
185 chromeos::switches::kGuestWallpaperSmall + "=" + 185 chromeos::switches::kGuestWallpaperSmall + "=" +
186 guest_small_file.value()); 186 guest_small_file.value());
187 const base::FilePath guest_large_file = 187 const base::FilePath guest_large_file =
188 dir.path().Append(FILE_PATH_LITERAL("guest_large.jpg")); 188 dir.GetPath().Append(FILE_PATH_LITERAL("guest_large.jpg"));
189 options.push_back(std::string("--") + 189 options.push_back(std::string("--") +
190 chromeos::switches::kGuestWallpaperLarge + "=" + 190 chromeos::switches::kGuestWallpaperLarge + "=" +
191 guest_large_file.value()); 191 guest_large_file.value());
192 192
193 const base::FilePath child_small_file = 193 const base::FilePath child_small_file =
194 dir.path().Append(FILE_PATH_LITERAL("child_small.jpg")); 194 dir.GetPath().Append(FILE_PATH_LITERAL("child_small.jpg"));
195 options.push_back(std::string("--") + 195 options.push_back(std::string("--") +
196 chromeos::switches::kChildWallpaperSmall + "=" + 196 chromeos::switches::kChildWallpaperSmall + "=" +
197 child_small_file.value()); 197 child_small_file.value());
198 const base::FilePath child_large_file = 198 const base::FilePath child_large_file =
199 dir.path().Append(FILE_PATH_LITERAL("child_large.jpg")); 199 dir.GetPath().Append(FILE_PATH_LITERAL("child_large.jpg"));
200 options.push_back(std::string("--") + 200 options.push_back(std::string("--") +
201 chromeos::switches::kChildWallpaperLarge + "=" + 201 chromeos::switches::kChildWallpaperLarge + "=" +
202 child_large_file.value()); 202 child_large_file.value());
203 203
204 ASSERT_TRUE(WriteJPEGFile( 204 ASSERT_TRUE(WriteJPEGFile(
205 small_file, kWallpaperSize, kWallpaperSize, kSmallDefaultWallpaperColor)); 205 small_file, kWallpaperSize, kWallpaperSize, kSmallDefaultWallpaperColor));
206 ASSERT_TRUE(WriteJPEGFile( 206 ASSERT_TRUE(WriteJPEGFile(
207 large_file, kWallpaperSize, kWallpaperSize, kLargeDefaultWallpaperColor)); 207 large_file, kWallpaperSize, kWallpaperSize, kLargeDefaultWallpaperColor));
208 208
209 ASSERT_TRUE(WriteJPEGFile(guest_small_file, 209 ASSERT_TRUE(WriteJPEGFile(guest_small_file,
(...skipping 14 matching lines...) Expand all
224 kWallpaperSize, 224 kWallpaperSize,
225 kLargeChildWallpaperColor)); 225 kLargeChildWallpaperColor));
226 226
227 command_line->reset(new base::CommandLine(options)); 227 command_line->reset(new base::CommandLine(options));
228 WallpaperManager::Get()->SetCommandLineForTesting(command_line->get()); 228 WallpaperManager::Get()->SetCommandLineForTesting(command_line->get());
229 } 229 }
230 230
231 } // namespace wallpaper_manager_test_utils 231 } // namespace wallpaper_manager_test_utils
232 232
233 } // namespace chromeos 233 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698