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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
9 #include "ash/desktop_background/desktop_background_controller_observer.h" | 9 #include "ash/desktop_background/desktop_background_controller_observer.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 GetUserWallpaperInfo(0, &info); | 316 GetUserWallpaperInfo(0, &info); |
317 ASSERT_EQ(User::DEFAULT, info.type); | 317 ASSERT_EQ(User::DEFAULT, info.type); |
318 ASSERT_EQ(original_background_color, GetAverageBackgroundColor()); | 318 ASSERT_EQ(original_background_color, GetAverageBackgroundColor()); |
319 | 319 |
320 // Check wallpaper change count to ensure that setting the second user's | 320 // Check wallpaper change count to ensure that setting the second user's |
321 // wallpaper didn't have any effect. | 321 // wallpaper didn't have any effect. |
322 ASSERT_EQ(4, wallpaper_change_count_); | 322 ASSERT_EQ(4, wallpaper_change_count_); |
323 } | 323 } |
324 | 324 |
325 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, | 325 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, |
326 PRE_PRE_PRE_WallpaperOnLoginScreen) { | 326 DISABLED_PRE_PRE_PRE_WallpaperOnLoginScreen) { |
327 RegisterUser(kTestUsers[0]); | 327 RegisterUser(kTestUsers[0]); |
328 RegisterUser(kTestUsers[1]); | 328 RegisterUser(kTestUsers[1]); |
329 StartupUtils::MarkOobeCompleted(); | 329 StartupUtils::MarkOobeCompleted(); |
330 } | 330 } |
331 | 331 |
332 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, | 332 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, |
333 PRE_PRE_WallpaperOnLoginScreen) { | 333 DISABLED_PRE_PRE_WallpaperOnLoginScreen) { |
334 LoginUser(kTestUsers[0]); | 334 LoginUser(kTestUsers[0]); |
335 | 335 |
336 // Wait until default wallpaper has been loaded. | 336 // Wait until default wallpaper has been loaded. |
337 RunUntilWallpaperChangeCount(1); | 337 RunUntilWallpaperChangeCount(1); |
338 | 338 |
339 // Set wallpaper policy to red image. | 339 // Set wallpaper policy to red image. |
340 InjectPolicy(0, kRedImageFileName); | 340 InjectPolicy(0, kRedImageFileName); |
341 | 341 |
342 // Run until wallpaper has changed. | 342 // Run until wallpaper has changed. |
343 RunUntilWallpaperChangeCount(2); | 343 RunUntilWallpaperChangeCount(2); |
344 ASSERT_EQ(kRedImageColor, GetAverageBackgroundColor()); | 344 ASSERT_EQ(kRedImageColor, GetAverageBackgroundColor()); |
345 } | 345 } |
346 | 346 |
347 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PRE_WallpaperOnLoginScreen) { | 347 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, |
| 348 DISABLED_PRE_WallpaperOnLoginScreen) { |
348 LoginUser(kTestUsers[1]); | 349 LoginUser(kTestUsers[1]); |
349 | 350 |
350 // Wait until default wallpaper has been loaded. | 351 // Wait until default wallpaper has been loaded. |
351 RunUntilWallpaperChangeCount(1); | 352 RunUntilWallpaperChangeCount(1); |
352 | 353 |
353 // Set wallpaper policy to green image. | 354 // Set wallpaper policy to green image. |
354 InjectPolicy(1, kGreenImageFileName); | 355 InjectPolicy(1, kGreenImageFileName); |
355 | 356 |
356 // Run until wallpaper has changed. | 357 // Run until wallpaper has changed. |
357 RunUntilWallpaperChangeCount(2); | 358 RunUntilWallpaperChangeCount(2); |
358 ASSERT_EQ(kGreenImageColor, GetAverageBackgroundColor()); | 359 ASSERT_EQ(kGreenImageColor, GetAverageBackgroundColor()); |
359 } | 360 } |
360 | 361 |
361 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, WallpaperOnLoginScreen) { | 362 // Disabled due to flakiness: http://crbug.com/385648. |
| 363 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, |
| 364 DISABLED_WallpaperOnLoginScreen) { |
362 // Wait for active pod's wallpaper to be loaded. | 365 // Wait for active pod's wallpaper to be loaded. |
363 RunUntilWallpaperChangeCount(1); | 366 RunUntilWallpaperChangeCount(1); |
364 ASSERT_EQ(kGreenImageColor, GetAverageBackgroundColor()); | 367 ASSERT_EQ(kGreenImageColor, GetAverageBackgroundColor()); |
365 | 368 |
366 // Select the second pod (belonging to user 1). | 369 // Select the second pod (belonging to user 1). |
367 ASSERT_TRUE(content::ExecuteScript( | 370 ASSERT_TRUE(content::ExecuteScript( |
368 static_cast<chromeos::LoginDisplayHostImpl*>( | 371 static_cast<chromeos::LoginDisplayHostImpl*>( |
369 chromeos::LoginDisplayHostImpl::default_host())->GetOobeUI()-> | 372 chromeos::LoginDisplayHostImpl::default_host())->GetOobeUI()-> |
370 web_ui()->GetWebContents(), | 373 web_ui()->GetWebContents(), |
371 "document.getElementsByClassName('pod')[1].focus();")); | 374 "document.getElementsByClassName('pod')[1].focus();")); |
(...skipping 22 matching lines...) Expand all Loading... |
394 | 397 |
395 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PersistOverLogout) { | 398 IN_PROC_BROWSER_TEST_F(WallpaperManagerPolicyTest, PersistOverLogout) { |
396 LoginUser(kTestUsers[0]); | 399 LoginUser(kTestUsers[0]); |
397 | 400 |
398 // Wait until wallpaper has been loaded. | 401 // Wait until wallpaper has been loaded. |
399 RunUntilWallpaperChangeCount(1); | 402 RunUntilWallpaperChangeCount(1); |
400 ASSERT_EQ(kRedImageColor, GetAverageBackgroundColor()); | 403 ASSERT_EQ(kRedImageColor, GetAverageBackgroundColor()); |
401 } | 404 } |
402 | 405 |
403 } // namespace chromeos | 406 } // namespace chromeos |
OLD | NEW |