Chromium Code Reviews| Index: components/precache/core/precache_database_unittest.cc |
| diff --git a/components/precache/core/precache_database_unittest.cc b/components/precache/core/precache_database_unittest.cc |
| index 233c2d0ce66aaa3c64af397d1752051aea94a51e..ce6250fa260252a7939f0456a366653a706b435a 100644 |
| --- a/components/precache/core/precache_database_unittest.cc |
| +++ b/components/precache/core/precache_database_unittest.cc |
| @@ -17,6 +17,7 @@ |
| #include "base/message_loop/message_loop.h" |
| #include "base/metrics/histogram_base.h" |
| #include "base/test/histogram_tester.h" |
| +#include "base/test/scoped_task_environment.h" |
| #include "base/time/time.h" |
| #include "components/history/core/browser/history_constants.h" |
| #include "net/http/http_response_headers.h" |
| @@ -89,7 +90,9 @@ namespace precache { |
| class PrecacheDatabaseTest : public testing::Test { |
| public: |
| - PrecacheDatabaseTest() {} |
| + PrecacheDatabaseTest() |
| + : scoped_task_environment_( |
| + base::test::ScopedTaskEnvironment::MainThreadType::UI) {} |
| ~PrecacheDatabaseTest() override {} |
| protected: |
| @@ -147,9 +150,8 @@ class PrecacheDatabaseTest : public testing::Test { |
| // Must be declared first so that it is destroyed last. |
| base::ScopedTempDir scoped_temp_dir_; |
| - // Having this MessageLoop member variable causes base::MessageLoop::current() |
| - // to be set properly. |
| - base::MessageLoopForUI loop_; |
| + // Having this member causes base::MessageLoop::current() to be set properly. |
|
gab
2017/04/28 01:43:00
This test doesn't use MessageLoop::current() nor d
fdoray
2017/05/01 17:16:51
There are good chances that a MessageLoop::current
|
| + base::test::ScopedTaskEnvironment scoped_task_environment_; |
| std::unique_ptr<PrecacheDatabase> precache_database_; |
| base::HistogramTester histograms_; |