| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/component_updater/sw_reporter_installer_win.h" | 5 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 const SwReporterInvocation& invocation = launched_invocations_.front(); | 84 const SwReporterInvocation& invocation = launched_invocations_.front(); |
| 85 EXPECT_EQ(MakeTestFilePath(default_path_), | 85 EXPECT_EQ(MakeTestFilePath(default_path_), |
| 86 invocation.command_line.GetProgram()); | 86 invocation.command_line.GetProgram()); |
| 87 EXPECT_EQ(1U, invocation.command_line.GetSwitches().size()); | 87 EXPECT_EQ(1U, invocation.command_line.GetSwitches().size()); |
| 88 EXPECT_EQ( | 88 EXPECT_EQ( |
| 89 40U, | 89 40U, |
| 90 invocation.command_line.GetSwitchValueASCII(kSessionIdSwitch).size()); | 90 invocation.command_line.GetSwitchValueASCII(kSessionIdSwitch).size()); |
| 91 EXPECT_TRUE(invocation.command_line.GetArgs().empty()); | 91 EXPECT_TRUE(invocation.command_line.GetArgs().empty()); |
| 92 EXPECT_TRUE(invocation.suffix.empty()); | 92 EXPECT_TRUE(invocation.suffix.empty()); |
| 93 EXPECT_EQ(SwReporterInvocation::BEHAVIOUR_LOG_TO_RAPPOR | | 93 EXPECT_EQ(SwReporterInvocation::BEHAVIOUR_LOG_EXIT_CODE_TO_PREFS | |
| 94 SwReporterInvocation::BEHAVIOUR_LOG_EXIT_CODE_TO_PREFS | | |
| 95 SwReporterInvocation::BEHAVIOUR_TRIGGER_PROMPT | | 94 SwReporterInvocation::BEHAVIOUR_TRIGGER_PROMPT | |
| 96 SwReporterInvocation::BEHAVIOUR_ALLOW_SEND_REPORTER_LOGS, | 95 SwReporterInvocation::BEHAVIOUR_ALLOW_SEND_REPORTER_LOGS, |
| 97 invocation.supported_behaviours); | 96 invocation.supported_behaviours); |
| 98 } | 97 } |
| 99 | 98 |
| 100 // |ComponentReady| asserts that it is run on the UI thread, so we must | 99 // |ComponentReady| asserts that it is run on the UI thread, so we must |
| 101 // create test threads before calling it. | 100 // create test threads before calling it. |
| 102 content::TestBrowserThreadBundle threads_; | 101 content::TestBrowserThreadBundle threads_; |
| 103 | 102 |
| 104 // Bound callback to the |SwReporterLaunched| method. | 103 // Bound callback to the |SwReporterLaunched| method. |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 traits.ComponentReady( | 729 traits.ComponentReady( |
| 731 default_version_, default_path_, | 730 default_version_, default_path_, |
| 732 base::DictionaryValue::From(base::JSONReader::Read(kTestManifest))); | 731 base::DictionaryValue::From(base::JSONReader::Read(kTestManifest))); |
| 733 | 732 |
| 734 // The SwReporter should not be launched, and an error should be logged. | 733 // The SwReporter should not be launched, and an error should be logged. |
| 735 EXPECT_TRUE(launched_invocations_.empty()); | 734 EXPECT_TRUE(launched_invocations_.empty()); |
| 736 histograms_.ExpectUniqueSample(kErrorHistogramName, | 735 histograms_.ExpectUniqueSample(kErrorHistogramName, |
| 737 SW_REPORTER_EXPERIMENT_ERROR_BAD_PARAMS, 1); | 736 SW_REPORTER_EXPERIMENT_ERROR_BAD_PARAMS, 1); |
| 738 } | 737 } |
| 739 } // namespace component_updater | 738 } // namespace component_updater |
| OLD | NEW |