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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_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
« no previous file with comments | « components/component_updater/timer_unittest.cc ('k') | components/favicon/core/favicon_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
index da671d3427219e53a51f8ae239274d81cc57e1cd..d05f679441fa8d7d1863bb0a4e71f4307ee5ae79 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
@@ -15,6 +15,7 @@
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/histogram_tester.h"
+#include "base/test/scoped_task_environment.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs.h"
@@ -112,7 +113,9 @@ const char kLastUpdateTime[] = "Wed, 18 Sep 2013 03:45:26";
class DataReductionProxyCompressionStatsTest : public testing::Test {
protected:
- DataReductionProxyCompressionStatsTest() {
+ DataReductionProxyCompressionStatsTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {
EXPECT_TRUE(base::Time::FromString(kLastUpdateTime, &now_));
}
@@ -473,7 +476,7 @@ class DataReductionProxyCompressionStatsTest : public testing::Test {
}
private:
- base::MessageLoopForUI loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<DataReductionProxyTestContext> drp_test_context_;
std::unique_ptr<DataReductionProxyCompressionStats> compression_stats_;
base::Time now_;
« no previous file with comments | « components/component_updater/timer_unittest.cc ('k') | components/favicon/core/favicon_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698