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

Unified Diff: chromeos/audio/cras_audio_handler_unittest.cc

Issue 2845973003: Use ScopedTaskEnvironment instead of MessageLoopForUI in chromeos tests. (Closed)
Patch Set: CR Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromeos/cryptohome/system_salt_getter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/cras_audio_handler_unittest.cc
diff --git a/chromeos/audio/cras_audio_handler_unittest.cc b/chromeos/audio/cras_audio_handler_unittest.cc
index 9c84174548ade5b8f288abbadcc43e2d979067b4..43011050a7a0677db583a69c4f93ea5eac0757d1 100644
--- a/chromeos/audio/cras_audio_handler_unittest.cc
+++ b/chromeos/audio/cras_audio_handler_unittest.cc
@@ -12,8 +12,8 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "chromeos/audio/audio_devices_pref_handler.h"
@@ -251,7 +251,9 @@ class FakeVideoCaptureManager {
// Test param is the version of stabel device id used by audio node.
class CrasAudioHandlerTest : public testing::TestWithParam<int> {
public:
- CrasAudioHandlerTest() {}
+ CrasAudioHandlerTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
~CrasAudioHandlerTest() override {}
void SetUp() override {
@@ -409,7 +411,7 @@ class CrasAudioHandlerTest : public testing::TestWithParam<int> {
}
protected:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
CrasAudioHandler* cras_audio_handler_ = nullptr; // Not owned.
FakeCrasAudioClient* fake_cras_audio_client_ = nullptr; // Not owned.
std::unique_ptr<TestObserver> test_observer_;
« no previous file with comments | « no previous file | chromeos/cryptohome/system_salt_getter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698