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

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

Issue 2347753002: Adds histograms for tracking Software Reporter logs uploads in SRT Fetcher. (Closed)
Patch Set: Define constant Created 4 years, 2 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/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
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::BEHAVIOUR_LOG_TO_RAPPOR |
59 SwReporterInvocation::FLAG_TRIGGER_PROMPT | 59 SwReporterInvocation::BEHAVIOUR_LOG_EXIT_CODE_TO_PREFS |
60 SwReporterInvocation::FLAG_SEND_REPORTER_LOGS; 60 SwReporterInvocation::BEHAVIOUR_TRIGGER_PROMPT |
61 SwReporterInvocation::BEHAVIOUR_ALLOW_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
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
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc ('k') | chrome/browser/safe_browsing/srt_fetcher_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698