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

Side by Side Diff: chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_browsertest_win.cc

Issue 2952163002: Remove InProcessBrowserTest::SetUpOnMainThread() calls. (Closed)
Patch Set: rebase Created 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chrome_cleaner/reporter_runner_win.h" 5 #include "chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_win.h"
6 6
7 #include <initializer_list> 7 #include <initializer_list>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 else 68 else
69 scoped_feature_list_.InitAndDisableFeature(kInBrowserCleanerUIFeature); 69 scoped_feature_list_.InitAndDisableFeature(kInBrowserCleanerUIFeature);
70 } 70 }
71 71
72 void SetUpOnMainThread() override { 72 void SetUpOnMainThread() override {
73 // During the test, use a task runner with a mock clock. 73 // During the test, use a task runner with a mock clock.
74 saved_task_runner_ = base::ThreadTaskRunnerHandle::Get(); 74 saved_task_runner_ = base::ThreadTaskRunnerHandle::Get();
75 ASSERT_NE(mock_time_task_runner_, saved_task_runner_); 75 ASSERT_NE(mock_time_task_runner_, saved_task_runner_);
76 base::MessageLoop::current()->SetTaskRunner(mock_time_task_runner_); 76 base::MessageLoop::current()->SetTaskRunner(mock_time_task_runner_);
77 77
78 InProcessBrowserTest::SetUpOnMainThread();
79
80 // SetDateInLocalState calculates a time as Now() minus an offset. Move the 78 // SetDateInLocalState calculates a time as Now() minus an offset. Move the
81 // simulated clock ahead far enough that this calculation won't underflow. 79 // simulated clock ahead far enough that this calculation won't underflow.
82 mock_time_task_runner_->FastForwardBy( 80 mock_time_task_runner_->FastForwardBy(
83 base::TimeDelta::FromDays(kDaysBetweenSuccessfulSwReporterRuns * 2)); 81 base::TimeDelta::FromDays(kDaysBetweenSuccessfulSwReporterRuns * 2));
84 82
85 ClearLastTimeSentReport(); 83 ClearLastTimeSentReport();
86 } 84 }
87 85
88 void TearDownOnMainThread() override { 86 void TearDownOnMainThread() override {
89 // Restore the standard task runner to perform browser cleanup, which will 87 // Restore the standard task runner to perform browser cleanup, which will
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 // testing framework. 652 // testing framework.
655 IN_PROC_BROWSER_TEST_F(ReporterRunnerPromptTest, InvokeDialog_SRTErrorNoFile) { 653 IN_PROC_BROWSER_TEST_F(ReporterRunnerPromptTest, InvokeDialog_SRTErrorNoFile) {
656 RunDialog(); 654 RunDialog();
657 } 655 }
658 656
659 IN_PROC_BROWSER_TEST_F(ReporterRunnerPromptTest, InvokeDialog_SRTErrorFile) { 657 IN_PROC_BROWSER_TEST_F(ReporterRunnerPromptTest, InvokeDialog_SRTErrorFile) {
660 RunDialog(); 658 RunDialog();
661 } 659 }
662 660
663 } // namespace safe_browsing 661 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698