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/srt_fetcher_win.h" | 5 #include "chrome/browser/safe_browsing/srt_fetcher_win.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 InProcessBrowserTest::SetUpOnMainThread(); | 47 InProcessBrowserTest::SetUpOnMainThread(); |
48 ClearLastTimeSentReport(); | 48 ClearLastTimeSentReport(); |
49 } | 49 } |
50 | 50 |
51 void TearDownInProcessBrowserTestFixture() override { | 51 void TearDownInProcessBrowserTestFixture() override { |
52 SetSwReporterTestingDelegate(nullptr); | 52 SetSwReporterTestingDelegate(nullptr); |
53 } | 53 } |
54 | 54 |
55 void RunReporter(const base::FilePath& exe_path = base::FilePath()) { | 55 void RunReporter(const base::FilePath& exe_path = base::FilePath()) { |
56 auto invocation = SwReporterInvocation::FromFilePath(exe_path); | 56 auto invocation = SwReporterInvocation::FromFilePath(exe_path); |
57 invocation.flags = SwReporterInvocation::FLAG_LOG_TO_RAPPOR | | 57 invocation.supported_behaviours = |
58 SwReporterInvocation::FLAG_LOG_EXIT_CODE_TO_PREFS | | 58 SwReporterInvocation::REPORTER_BEHAVIOUR_LOG_TO_RAPPOR | |
59 SwReporterInvocation::FLAG_TRIGGER_PROMPT | | 59 SwReporterInvocation::REPORTER_BEHAVIOUR_LOG_EXIT_CODE_TO_PREFS | |
60 SwReporterInvocation::FLAG_SEND_REPORTER_LOGS; | 60 SwReporterInvocation::REPORTER_BEHAVIOUR_TRIGGER_PROMPT | |
| 61 SwReporterInvocation::REPORTER_BEHAVIOUR_SEND_REPORTER_LOGS; |
61 | 62 |
62 SwReporterQueue invocations; | 63 SwReporterQueue invocations; |
63 invocations.push(invocation); | 64 invocations.push(invocation); |
64 RunSwReporters(invocations, base::Version("1.2.3"), task_runner_, | 65 RunSwReporters(invocations, base::Version("1.2.3"), task_runner_, |
65 task_runner_); | 66 task_runner_); |
66 } | 67 } |
67 | 68 |
68 void RunReporterQueue(const SwReporterQueue& invocations) { | 69 void RunReporterQueue(const SwReporterQueue& invocations) { |
69 RunSwReporters(invocations, base::Version("1.2.3"), task_runner_, | 70 RunSwReporters(invocations, base::Version("1.2.3"), task_runner_, |
70 task_runner_); | 71 task_runner_); |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 EnableSBExtendedReporting(); | 610 EnableSBExtendedReporting(); |
610 SetLastTimeSentReport(kDaysBetweenReporterLogsSent - 1); | 611 SetLastTimeSentReport(kDaysBetweenReporterLogsSent - 1); |
611 int64_t last_time_sent_logs = GetLastTimeSentReport(); | 612 int64_t last_time_sent_logs = GetLastTimeSentReport(); |
612 RunReporter(); | 613 RunReporter(); |
613 TestReporterLaunchCycle({base::FilePath()}); | 614 TestReporterLaunchCycle({base::FilePath()}); |
614 ExpectLoggingSwitches(std::set<std::string>{/*expect no switches*/}); | 615 ExpectLoggingSwitches(std::set<std::string>{/*expect no switches*/}); |
615 EXPECT_EQ(last_time_sent_logs, GetLastTimeSentReport()); | 616 EXPECT_EQ(last_time_sent_logs, GetLastTimeSentReport()); |
616 } | 617 } |
617 | 618 |
618 } // namespace safe_browsing | 619 } // namespace safe_browsing |
OLD | NEW |