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

Side by Side Diff: components/previews/previews_ui_service_unittest.cc

Issue 2348503002: Remove calls to deprecated MessageLoop methods in components/previews/. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « components/previews/previews_io_data_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/previews/previews_ui_service.h" 5 #include "components/previews/previews_ui_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/run_loop.h"
12 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
13 #include "components/previews/previews_io_data.h" 14 #include "components/previews/previews_io_data.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 namespace previews { 17 namespace previews {
17 18
18 namespace { 19 namespace {
19 20
20 class TestPreviewsUIService : public PreviewsUIService { 21 class TestPreviewsUIService : public PreviewsUIService {
21 public: 22 public:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 std::unique_ptr<TestPreviewsUIService> ui_service_; 68 std::unique_ptr<TestPreviewsUIService> ui_service_;
68 }; 69 };
69 70
70 } // namespace 71 } // namespace
71 72
72 TEST_F(PreviewsUIServiceTest, TestInitialization) { 73 TEST_F(PreviewsUIServiceTest, TestInitialization) {
73 set_io_data(base::WrapUnique( 74 set_io_data(base::WrapUnique(
74 new PreviewsIOData(loop_.task_runner(), loop_.task_runner()))); 75 new PreviewsIOData(loop_.task_runner(), loop_.task_runner())));
75 set_ui_service(base::WrapUnique( 76 set_ui_service(base::WrapUnique(
76 new TestPreviewsUIService(io_data(), loop_.task_runner()))); 77 new TestPreviewsUIService(io_data(), loop_.task_runner())));
77 loop_.RunUntilIdle(); 78 base::RunLoop().RunUntilIdle();
78 // After the outstanding posted tasks have run, SetIOData should have been 79 // After the outstanding posted tasks have run, SetIOData should have been
79 // called for |ui_service_|. 80 // called for |ui_service_|.
80 EXPECT_TRUE(ui_service()->io_data_set()); 81 EXPECT_TRUE(ui_service()->io_data_set());
81 } 82 }
82 83
83 } // namespace previews 84 } // namespace previews
OLDNEW
« no previous file with comments | « components/previews/previews_io_data_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698