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 <cstdlib> | 5 #include <cstdlib> |
6 #include <cstring> | 6 #include <cstring> |
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 30 matching lines...) Expand all Loading... |
41 WallpaperManagerCacheTest() | 41 WallpaperManagerCacheTest() |
42 : fake_user_manager_(new FakeUserManager()), | 42 : fake_user_manager_(new FakeUserManager()), |
43 scoped_user_manager_(fake_user_manager_) { | 43 scoped_user_manager_(fake_user_manager_) { |
44 } | 44 } |
45 | 45 |
46 protected: | 46 protected: |
47 virtual ~WallpaperManagerCacheTest() {} | 47 virtual ~WallpaperManagerCacheTest() {} |
48 | 48 |
49 FakeUserManager* fake_user_manager() { return fake_user_manager_; } | 49 FakeUserManager* fake_user_manager() { return fake_user_manager_; } |
50 | 50 |
51 virtual void SetUp() OVERRIDE { | 51 virtual void SetUp() override { |
52 test::AshTestBase::SetUp(); | 52 test::AshTestBase::SetUp(); |
53 } | 53 } |
54 | 54 |
55 // Creates a test image of size 1x1. | 55 // Creates a test image of size 1x1. |
56 gfx::ImageSkia CreateTestImage(SkColor color) { | 56 gfx::ImageSkia CreateTestImage(SkColor color) { |
57 SkBitmap bitmap; | 57 SkBitmap bitmap; |
58 bitmap.allocN32Pixels(1, 1); | 58 bitmap.allocN32Pixels(1, 1); |
59 bitmap.eraseColor(color); | 59 bitmap.eraseColor(color); |
60 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 60 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
61 } | 61 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Logged in users' wallpaper cache should be kept. | 95 // Logged in users' wallpaper cache should be kept. |
96 EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(test_user_1_wallpaper)); | 96 EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(test_user_1_wallpaper)); |
97 EXPECT_TRUE(test_api->GetWallpaperFromCache(test_user_2, &cached_wallpaper)); | 97 EXPECT_TRUE(test_api->GetWallpaperFromCache(test_user_2, &cached_wallpaper)); |
98 EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(test_user_2_wallpaper)); | 98 EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(test_user_2_wallpaper)); |
99 | 99 |
100 // Not logged in user's wallpaper cache should be cleared. | 100 // Not logged in user's wallpaper cache should be cleared. |
101 EXPECT_FALSE(test_api->GetWallpaperFromCache(test_user_3, &cached_wallpaper)); | 101 EXPECT_FALSE(test_api->GetWallpaperFromCache(test_user_3, &cached_wallpaper)); |
102 } | 102 } |
103 | 103 |
104 } // namespace chromeos | 104 } // namespace chromeos |
OLD | NEW |