OLD | NEW |
---|---|
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 Loading... | |
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 | 78 |
benwells
2017/06/23 03:10:16
Nit: extra blank line.
Lei Zhang
2017/06/27 07:06:04
Done.
| |
80 // SetDateInLocalState calculates a time as Now() minus an offset. Move the | 79 // SetDateInLocalState calculates a time as Now() minus an offset. Move the |
81 // simulated clock ahead far enough that this calculation won't underflow. | 80 // simulated clock ahead far enough that this calculation won't underflow. |
82 mock_time_task_runner_->FastForwardBy( | 81 mock_time_task_runner_->FastForwardBy( |
83 base::TimeDelta::FromDays(kDaysBetweenSuccessfulSwReporterRuns * 2)); | 82 base::TimeDelta::FromDays(kDaysBetweenSuccessfulSwReporterRuns * 2)); |
84 | 83 |
85 ClearLastTimeSentReport(); | 84 ClearLastTimeSentReport(); |
86 } | 85 } |
87 | 86 |
88 void TearDownOnMainThread() override { | 87 void TearDownOnMainThread() override { |
89 // Restore the standard task runner to perform browser cleanup, which will | 88 // Restore the standard task runner to perform browser cleanup, which will |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 // testing framework. | 655 // testing framework. |
657 IN_PROC_BROWSER_TEST_F(ReporterRunnerPromptTest, InvokeDialog_SRTErrorNoFile) { | 656 IN_PROC_BROWSER_TEST_F(ReporterRunnerPromptTest, InvokeDialog_SRTErrorNoFile) { |
658 RunDialog(); | 657 RunDialog(); |
659 } | 658 } |
660 | 659 |
661 IN_PROC_BROWSER_TEST_F(ReporterRunnerPromptTest, InvokeDialog_SRTErrorFile) { | 660 IN_PROC_BROWSER_TEST_F(ReporterRunnerPromptTest, InvokeDialog_SRTErrorFile) { |
662 RunDialog(); | 661 RunDialog(); |
663 } | 662 } |
664 | 663 |
665 } // namespace safe_browsing | 664 } // namespace safe_browsing |
OLD | NEW |