Index: components/previews/core/previews_ui_service_unittest.cc |
diff --git a/components/previews/core/previews_ui_service_unittest.cc b/components/previews/core/previews_ui_service_unittest.cc |
index 47b448192c3b934120577a3abe6e58ffd6dcf7cf..a3816fa22025923bde4c7b60f2c8a47e543fe559 100644 |
--- a/components/previews/core/previews_ui_service_unittest.cc |
+++ b/components/previews/core/previews_ui_service_unittest.cc |
@@ -2,35 +2,37 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
#include "components/previews/core/previews_ui_service.h" |
#include <memory> |
#include "base/memory/ptr_util.h" |
#include "base/memory/ref_counted.h" |
#include "base/message_loop/message_loop.h" |
-#include "base/run_loop.h" |
#include "base/single_thread_task_runner.h" |
#include "components/previews/core/previews_io_data.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace previews { |
namespace { |
class TestPreviewsUIService : public PreviewsUIService { |
public: |
TestPreviewsUIService( |
PreviewsIOData* previews_io_data, |
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) |
- : PreviewsUIService(previews_io_data, io_task_runner), |
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
+ std::unique_ptr<PreviewsOptOutStore> previews_opt_out_store) |
+ : PreviewsUIService(previews_io_data, |
+ io_task_runner, |
+ std::move(previews_opt_out_store)), |
io_data_set_(false) {} |
~TestPreviewsUIService() override {} |
// Set |io_data_set_| to true and use base class functionality. |
void SetIOData(base::WeakPtr<PreviewsIOData> previews_io_data) override { |
io_data_set_ = true; |
PreviewsUIService::SetIOData(previews_io_data); |
} |
// Whether SetIOData was called. |
@@ -67,18 +69,18 @@ class PreviewsUIServiceTest : public testing::Test { |
std::unique_ptr<PreviewsIOData> io_data_; |
std::unique_ptr<TestPreviewsUIService> ui_service_; |
}; |
} // namespace |
TEST_F(PreviewsUIServiceTest, TestInitialization) { |
set_io_data(base::WrapUnique( |
new PreviewsIOData(loop_.task_runner(), loop_.task_runner()))); |
set_ui_service(base::WrapUnique( |
- new TestPreviewsUIService(io_data(), loop_.task_runner()))); |
- base::RunLoop().RunUntilIdle(); |
+ new TestPreviewsUIService(io_data(), loop_.task_runner(), nullptr))); |
+ loop_.RunUntilIdle(); |
// After the outstanding posted tasks have run, SetIOData should have been |
// called for |ui_service_|. |
EXPECT_TRUE(ui_service()->io_data_set()); |
} |
} // namespace previews |