Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: components/wallpaper/wallpaper_resizer_unittest.cc

Issue 2082333002: Remove calls to deprecated MessageLoop methods in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/wallpaper/wallpaper_resizer.h" 5 #include "components/wallpaper/wallpaper_resizer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/run_loop.h"
13 #include "base/test/sequenced_worker_pool_owner.h" 14 #include "base/test/sequenced_worker_pool_owner.h"
14 #include "components/wallpaper/wallpaper_resizer_observer.h" 15 #include "components/wallpaper/wallpaper_resizer_observer.h"
15 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
16 #include "ui/gfx/image/image_skia_rep.h" 17 #include "ui/gfx/image/image_skia_rep.h"
17 18
18 namespace { 19 namespace {
19 20
20 const int kTestImageWidth = 5; 21 const int kTestImageWidth = 5;
21 const int kTestImageHeight = 2; 22 const int kTestImageHeight = 2;
22 const int kTargetWidth = 1; 23 const int kTargetWidth = 1;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 resizer->StartResize(); 75 resizer->StartResize();
75 WaitForResize(); 76 WaitForResize();
76 resizer->RemoveObserver(this); 77 resizer->RemoveObserver(this);
77 return resizer->image(); 78 return resizer->image();
78 } 79 }
79 80
80 base::SequencedWorkerPool* worker_pool() { 81 base::SequencedWorkerPool* worker_pool() {
81 return worker_pool_owner_.pool().get(); 82 return worker_pool_owner_.pool().get();
82 } 83 }
83 84
84 void WaitForResize() { message_loop_.Run(); } 85 void WaitForResize() { base::RunLoop().Run(); }
85 86
86 void OnWallpaperResized() override { message_loop_.QuitWhenIdle(); } 87 void OnWallpaperResized() override { message_loop_.QuitWhenIdle(); }
87 88
88 private: 89 private:
89 base::MessageLoop message_loop_; 90 base::MessageLoop message_loop_;
90 base::SequencedWorkerPoolOwner worker_pool_owner_; 91 base::SequencedWorkerPoolOwner worker_pool_owner_;
91 92
92 DISALLOW_COPY_AND_ASSIGN(WallpaperResizerTest); 93 DISALLOW_COPY_AND_ASSIGN(WallpaperResizerTest);
93 }; 94 };
94 95
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 worker_pool()); 152 worker_pool());
152 EXPECT_EQ(WallpaperResizer::GetImageId(image), resizer.original_image_id()); 153 EXPECT_EQ(WallpaperResizer::GetImageId(image), resizer.original_image_id());
153 resizer.AddObserver(this); 154 resizer.AddObserver(this);
154 resizer.StartResize(); 155 resizer.StartResize();
155 WaitForResize(); 156 WaitForResize();
156 resizer.RemoveObserver(this); 157 resizer.RemoveObserver(this);
157 EXPECT_EQ(WallpaperResizer::GetImageId(image), resizer.original_image_id()); 158 EXPECT_EQ(WallpaperResizer::GetImageId(image), resizer.original_image_id());
158 } 159 }
159 160
160 } // namespace ash 161 } // namespace ash
OLDNEW
« no previous file with comments | « components/tracing/child/child_trace_message_filter_unittest.cc ('k') | components/wifi/wifi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698