| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/desktop_background/wallpaper_resizer.h" | 5 #include "ash/desktop_background/wallpaper_resizer.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/wallpaper_resizer_observer.h" | 7 #include "ash/desktop_background/wallpaper_resizer_observer.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/public/test/test_browser_thread.h" | 9 #include "content/public/test/test_browser_thread.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 resizer->StartResize(); | 72 resizer->StartResize(); |
| 73 WaitForResize(); | 73 WaitForResize(); |
| 74 resizer->RemoveObserver(this); | 74 resizer->RemoveObserver(this); |
| 75 return resizer->image(); | 75 return resizer->image(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void WaitForResize() { | 78 void WaitForResize() { |
| 79 message_loop_.Run(); | 79 message_loop_.Run(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 virtual void OnWallpaperResized() OVERRIDE { | 82 virtual void OnWallpaperResized() override { |
| 83 message_loop_.Quit(); | 83 message_loop_.Quit(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 base::MessageLoop message_loop_; | 87 base::MessageLoop message_loop_; |
| 88 content::TestBrowserThread ui_thread_; | 88 content::TestBrowserThread ui_thread_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(WallpaperResizerTest); | 90 DISALLOW_COPY_AND_ASSIGN(WallpaperResizerTest); |
| 91 }; | 91 }; |
| 92 | 92 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 WallpaperResizer resizer(image, gfx::Size(10, 20), WALLPAPER_LAYOUT_STRETCH); | 148 WallpaperResizer resizer(image, gfx::Size(10, 20), WALLPAPER_LAYOUT_STRETCH); |
| 149 EXPECT_EQ(WallpaperResizer::GetImageId(image), resizer.original_image_id()); | 149 EXPECT_EQ(WallpaperResizer::GetImageId(image), resizer.original_image_id()); |
| 150 resizer.AddObserver(this); | 150 resizer.AddObserver(this); |
| 151 resizer.StartResize(); | 151 resizer.StartResize(); |
| 152 WaitForResize(); | 152 WaitForResize(); |
| 153 resizer.RemoveObserver(this); | 153 resizer.RemoveObserver(this); |
| 154 EXPECT_EQ(WallpaperResizer::GetImageId(image), resizer.original_image_id()); | 154 EXPECT_EQ(WallpaperResizer::GetImageId(image), resizer.original_image_id()); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace ash | 157 } // namespace ash |
| OLD | NEW |