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

Unified Diff: components/gcm_driver/instance_id/instance_id_driver_unittest.cc

Issue 2846723005: Use ScopedTaskEnvironment instead of MessageLoopForUI in components tests. (Closed)
Patch Set: fix-test-errors 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
Index: components/gcm_driver/instance_id/instance_id_driver_unittest.cc
diff --git a/components/gcm_driver/instance_id/instance_id_driver_unittest.cc b/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
index 7b4e722e01c9021fa2de916592c4e6e98abc86a9..b8c663feddee6acbd2479ca4e28003fe7a795f94 100644
--- a/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
+++ b/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
@@ -10,9 +10,9 @@
#include "base/bind.h"
#include "base/macros.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
+#include "base/test/scoped_task_environment.h"
#include "components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h"
#include "components/gcm_driver/instance_id/instance_id.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -87,7 +87,7 @@ class InstanceIDDriverTest : public testing::Test {
void GetTokenCompleted(const std::string& token, InstanceID::Result result);
void DeleteTokenCompleted(InstanceID::Result result);
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<FakeGCMDriverForInstanceID> gcm_driver_;
std::unique_ptr<InstanceIDDriver> driver_;
@@ -108,9 +108,10 @@ class InstanceIDDriverTest : public testing::Test {
};
InstanceIDDriverTest::InstanceIDDriverTest()
- : result_(InstanceID::UNKNOWN_ERROR),
- async_operation_completed_(false) {
-}
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ result_(InstanceID::UNKNOWN_ERROR),
+ async_operation_completed_(false) {}
InstanceIDDriverTest::~InstanceIDDriverTest() {
}
« no previous file with comments | « components/favicon/core/favicon_handler_unittest.cc ('k') | components/history/core/browser/history_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698