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

Side by Side Diff: chrome/browser/safe_browsing/download_feedback_service_unittest.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/safe_browsing/download_feedback_service.h" 5 #include "chrome/browser/safe_browsing/download_feedback_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 EXPECT_FALSE(DownloadFeedbackService::IsEnabledForDownload(item)); 125 EXPECT_FALSE(DownloadFeedbackService::IsEnabledForDownload(item));
126 DownloadFeedbackService::MaybeStorePingsForDownload(result, &item, "a", "b"); 126 DownloadFeedbackService::MaybeStorePingsForDownload(result, &item, "a", "b");
127 return DownloadFeedbackService::IsEnabledForDownload(item); 127 return DownloadFeedbackService::IsEnabledForDownload(item);
128 } 128 }
129 129
130 } // namespace 130 } // namespace
131 131
132 class DownloadFeedbackServiceTest : public testing::Test { 132 class DownloadFeedbackServiceTest : public testing::Test {
133 public: 133 public:
134 DownloadFeedbackServiceTest() 134 DownloadFeedbackServiceTest()
135 : file_task_runner_(content::BrowserThread::GetMessageLoopProxyForThread( 135 : file_task_runner_(content::BrowserThread::GetTaskRunnerForThread(
136 content::BrowserThread::FILE)), 136 content::BrowserThread::FILE)),
137 io_task_runner_(content::BrowserThread::GetMessageLoopProxyForThread( 137 io_task_runner_(content::BrowserThread::GetTaskRunnerForThread(
138 content::BrowserThread::IO)), 138 content::BrowserThread::IO)),
139 request_context_getter_( 139 request_context_getter_(
140 new net::TestURLRequestContextGetter(io_task_runner_)) { 140 new net::TestURLRequestContextGetter(io_task_runner_)) {}
141 }
142 141
143 void SetUp() override { 142 void SetUp() override {
144 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 143 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
145 DownloadFeedback::RegisterFactory(&download_feedback_factory_); 144 DownloadFeedback::RegisterFactory(&download_feedback_factory_);
146 } 145 }
147 146
148 void TearDown() override { DownloadFeedback::RegisterFactory(NULL); } 147 void TearDown() override { DownloadFeedback::RegisterFactory(NULL); }
149 148
150 base::FilePath CreateTestFile(int n) const { 149 base::FilePath CreateTestFile(int n) const {
151 base::FilePath upload_file_path( 150 base::FilePath upload_file_path(
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 // was deleted. 368 // was deleted.
370 EXPECT_FALSE(base::PathExists(file_path[2])); 369 EXPECT_FALSE(base::PathExists(file_path[2]));
371 370
372 // These files should still exist since the FakeDownloadFeedback does not 371 // These files should still exist since the FakeDownloadFeedback does not
373 // delete them. 372 // delete them.
374 EXPECT_TRUE(base::PathExists(file_path[0])); 373 EXPECT_TRUE(base::PathExists(file_path[0]));
375 EXPECT_TRUE(base::PathExists(file_path[1])); 374 EXPECT_TRUE(base::PathExists(file_path[1]));
376 } 375 }
377 376
378 } // namespace safe_browsing 377 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698