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.h" | 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wallpaper/wallpaper_controller.h" | 10 #include "ash/wallpaper/wallpaper_controller.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 namespace chromeos { | 51 namespace chromeos { |
52 | 52 |
53 namespace { | 53 namespace { |
54 | 54 |
55 int kLargeWallpaperWidth = 256; | 55 int kLargeWallpaperWidth = 256; |
56 int kLargeWallpaperHeight = wallpaper::kLargeWallpaperMaxHeight; | 56 int kLargeWallpaperHeight = wallpaper::kLargeWallpaperMaxHeight; |
57 int kSmallWallpaperWidth = 256; | 57 int kSmallWallpaperWidth = 256; |
58 int kSmallWallpaperHeight = wallpaper::kSmallWallpaperMaxHeight; | 58 int kSmallWallpaperHeight = wallpaper::kSmallWallpaperMaxHeight; |
59 | 59 |
60 const char kTestUser1[] = "test1@domain.com"; | 60 const char kTestUser1Email[] = "test1@domain.com"; |
| 61 const char kTestUser1Id[] = "1234567890123456789012"; |
61 const char kTestUser1Hash[] = "test1@domain.com-hash"; | 62 const char kTestUser1Hash[] = "test1@domain.com-hash"; |
62 const char kTestUser2[] = "test2@domain.com"; | 63 const char kTestUser2Email[] = "test2@domain.com"; |
| 64 const char kTestUser2Id[] = "1234567890123456789013"; |
63 const char kTestUser2Hash[] = "test2@domain.com-hash"; | 65 const char kTestUser2Hash[] = "test2@domain.com-hash"; |
64 | 66 |
65 } // namespace | 67 } // namespace |
66 | 68 |
67 class WallpaperManagerBrowserTest : public InProcessBrowserTest { | 69 class WallpaperManagerBrowserTest : public InProcessBrowserTest { |
68 public: | 70 public: |
69 WallpaperManagerBrowserTest() : controller_(NULL), | 71 WallpaperManagerBrowserTest() : controller_(NULL), |
70 local_state_(NULL) { | 72 local_state_(NULL) { |
71 } | 73 } |
72 | 74 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 166 } |
165 | 167 |
166 ash::WallpaperController* controller_; | 168 ash::WallpaperController* controller_; |
167 PrefService* local_state_; | 169 PrefService* local_state_; |
168 std::unique_ptr<base::CommandLine> wallpaper_manager_command_line_; | 170 std::unique_ptr<base::CommandLine> wallpaper_manager_command_line_; |
169 | 171 |
170 // Directory created by CreateCmdlineWallpapers () to store default | 172 // Directory created by CreateCmdlineWallpapers () to store default |
171 // wallpaper images. | 173 // wallpaper images. |
172 std::unique_ptr<base::ScopedTempDir> wallpaper_dir_; | 174 std::unique_ptr<base::ScopedTempDir> wallpaper_dir_; |
173 | 175 |
174 const AccountId test_account_id1_ = AccountId::FromUserEmail(kTestUser1); | 176 const AccountId test_account_id1_ = |
175 const AccountId test_account_id2_ = AccountId::FromUserEmail(kTestUser2); | 177 AccountId::FromUserEmailGaiaId(kTestUser1Email, kTestUser1Id); |
| 178 const AccountId test_account_id2_ = |
| 179 AccountId::FromUserEmailGaiaId(kTestUser2Email, kTestUser2Id); |
176 | 180 |
177 const wallpaper::WallpaperFilesId test_account1_wallpaper_files_id_ = | 181 const wallpaper::WallpaperFilesId test_account1_wallpaper_files_id_ = |
178 wallpaper::WallpaperFilesId::FromString(kTestUser1Hash); | 182 wallpaper::WallpaperFilesId::FromString(kTestUser1Hash); |
179 const wallpaper::WallpaperFilesId test_account2_wallpaper_files_id_ = | 183 const wallpaper::WallpaperFilesId test_account2_wallpaper_files_id_ = |
180 wallpaper::WallpaperFilesId::FromString(kTestUser2Hash); | 184 wallpaper::WallpaperFilesId::FromString(kTestUser2Hash); |
181 | 185 |
182 private: | 186 private: |
183 DISALLOW_COPY_AND_ASSIGN(WallpaperManagerBrowserTest); | 187 DISALLOW_COPY_AND_ASSIGN(WallpaperManagerBrowserTest); |
184 }; | 188 }; |
185 | 189 |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 user_manager::StubAccountId(), | 854 user_manager::StubAccountId(), |
851 wallpaper::WallpaperFilesId::FromString("test_hash"), "test-nofile.jpeg", | 855 wallpaper::WallpaperFilesId::FromString("test_hash"), "test-nofile.jpeg", |
852 WALLPAPER_LAYOUT_STRETCH, user_manager::User::CUSTOMIZED, image, true); | 856 WALLPAPER_LAYOUT_STRETCH, user_manager::User::CUSTOMIZED, image, true); |
853 EXPECT_TRUE(WallpaperManager::Get()->IsPendingWallpaper( | 857 EXPECT_TRUE(WallpaperManager::Get()->IsPendingWallpaper( |
854 wallpaper::WallpaperResizer::GetImageId(image))); | 858 wallpaper::WallpaperResizer::GetImageId(image))); |
855 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); | 859 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); |
856 EXPECT_FALSE(WallpaperManager::Get()->IsPendingWallpaper( | 860 EXPECT_FALSE(WallpaperManager::Get()->IsPendingWallpaper( |
857 wallpaper::WallpaperResizer::GetImageId(image))); | 861 wallpaper::WallpaperResizer::GetImageId(image))); |
858 } | 862 } |
859 } // namespace chromeos | 863 } // namespace chromeos |
OLD | NEW |