| OLD | NEW |
| 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 "ash/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void WaitAsyncWallpaperLoadFinished() { | 163 void WaitAsyncWallpaperLoadFinished() { |
| 164 TestWallpaperObserverPendingListEmpty observer(WallpaperManager::Get()); | 164 TestWallpaperObserverPendingListEmpty observer(WallpaperManager::Get()); |
| 165 observer.WaitForPendingListEmpty(); | 165 observer.WaitForPendingListEmpty(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void CreateCmdlineWallpapers(const base::ScopedTempDir& dir, | 168 void CreateCmdlineWallpapers(const base::ScopedTempDir& dir, |
| 169 std::unique_ptr<base::CommandLine>* command_line) { | 169 std::unique_ptr<base::CommandLine>* command_line) { |
| 170 std::vector<std::string> options; | 170 std::vector<std::string> options; |
| 171 options.push_back(std::string("WM_Test_cmdline")); | 171 options.push_back(std::string("WM_Test_cmdline")); |
| 172 const base::FilePath small_file = | 172 const base::FilePath small_file = |
| 173 dir.path().Append(FILE_PATH_LITERAL("small.jpg")); | 173 dir.GetPath().Append(FILE_PATH_LITERAL("small.jpg")); |
| 174 options.push_back(std::string("--") + | 174 options.push_back(std::string("--") + |
| 175 chromeos::switches::kDefaultWallpaperSmall + "=" + | 175 chromeos::switches::kDefaultWallpaperSmall + "=" + |
| 176 small_file.value()); | 176 small_file.value()); |
| 177 const base::FilePath large_file = | 177 const base::FilePath large_file = |
| 178 dir.path().Append(FILE_PATH_LITERAL("large.jpg")); | 178 dir.GetPath().Append(FILE_PATH_LITERAL("large.jpg")); |
| 179 options.push_back(std::string("--") + | 179 options.push_back(std::string("--") + |
| 180 chromeos::switches::kDefaultWallpaperLarge + "=" + | 180 chromeos::switches::kDefaultWallpaperLarge + "=" + |
| 181 large_file.value()); | 181 large_file.value()); |
| 182 | 182 |
| 183 const base::FilePath guest_small_file = | 183 const base::FilePath guest_small_file = |
| 184 dir.path().Append(FILE_PATH_LITERAL("guest_small.jpg")); | 184 dir.GetPath().Append(FILE_PATH_LITERAL("guest_small.jpg")); |
| 185 options.push_back(std::string("--") + | 185 options.push_back(std::string("--") + |
| 186 chromeos::switches::kGuestWallpaperSmall + "=" + | 186 chromeos::switches::kGuestWallpaperSmall + "=" + |
| 187 guest_small_file.value()); | 187 guest_small_file.value()); |
| 188 const base::FilePath guest_large_file = | 188 const base::FilePath guest_large_file = |
| 189 dir.path().Append(FILE_PATH_LITERAL("guest_large.jpg")); | 189 dir.GetPath().Append(FILE_PATH_LITERAL("guest_large.jpg")); |
| 190 options.push_back(std::string("--") + | 190 options.push_back(std::string("--") + |
| 191 chromeos::switches::kGuestWallpaperLarge + "=" + | 191 chromeos::switches::kGuestWallpaperLarge + "=" + |
| 192 guest_large_file.value()); | 192 guest_large_file.value()); |
| 193 | 193 |
| 194 const base::FilePath child_small_file = | 194 const base::FilePath child_small_file = |
| 195 dir.path().Append(FILE_PATH_LITERAL("child_small.jpg")); | 195 dir.GetPath().Append(FILE_PATH_LITERAL("child_small.jpg")); |
| 196 options.push_back(std::string("--") + | 196 options.push_back(std::string("--") + |
| 197 chromeos::switches::kChildWallpaperSmall + "=" + | 197 chromeos::switches::kChildWallpaperSmall + "=" + |
| 198 child_small_file.value()); | 198 child_small_file.value()); |
| 199 const base::FilePath child_large_file = | 199 const base::FilePath child_large_file = |
| 200 dir.path().Append(FILE_PATH_LITERAL("child_large.jpg")); | 200 dir.GetPath().Append(FILE_PATH_LITERAL("child_large.jpg")); |
| 201 options.push_back(std::string("--") + | 201 options.push_back(std::string("--") + |
| 202 chromeos::switches::kChildWallpaperLarge + "=" + | 202 chromeos::switches::kChildWallpaperLarge + "=" + |
| 203 child_large_file.value()); | 203 child_large_file.value()); |
| 204 | 204 |
| 205 ASSERT_TRUE(WriteJPEGFile( | 205 ASSERT_TRUE(WriteJPEGFile( |
| 206 small_file, kWallpaperSize, kWallpaperSize, kSmallDefaultWallpaperColor)); | 206 small_file, kWallpaperSize, kWallpaperSize, kSmallDefaultWallpaperColor)); |
| 207 ASSERT_TRUE(WriteJPEGFile( | 207 ASSERT_TRUE(WriteJPEGFile( |
| 208 large_file, kWallpaperSize, kWallpaperSize, kLargeDefaultWallpaperColor)); | 208 large_file, kWallpaperSize, kWallpaperSize, kLargeDefaultWallpaperColor)); |
| 209 | 209 |
| 210 ASSERT_TRUE(WriteJPEGFile(guest_small_file, | 210 ASSERT_TRUE(WriteJPEGFile(guest_small_file, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 225 kWallpaperSize, | 225 kWallpaperSize, |
| 226 kLargeChildWallpaperColor)); | 226 kLargeChildWallpaperColor)); |
| 227 | 227 |
| 228 command_line->reset(new base::CommandLine(options)); | 228 command_line->reset(new base::CommandLine(options)); |
| 229 WallpaperManager::Get()->SetCommandLineForTesting(command_line->get()); | 229 WallpaperManager::Get()->SetCommandLineForTesting(command_line->get()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace wallpaper_manager_test_utils | 232 } // namespace wallpaper_manager_test_utils |
| 233 | 233 |
| 234 } // namespace chromeos | 234 } // namespace chromeos |
| OLD | NEW |