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

Side by Side Diff: chrome/browser/component_updater/chrome_component_updater_configurator_unittest.cc

Issue 2199423002: Mechanical change in the component updater Configurator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/component_updater/chrome_component_updater_configurator .h" 10 #include "chrome/browser/component_updater/chrome_component_updater_configurator .h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 TEST(ChromeComponentUpdaterConfiguratorTest, TestUpdaterDefaultUrl) { 70 TEST(ChromeComponentUpdaterConfiguratorTest, TestUpdaterDefaultUrl) {
71 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); 71 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess());
72 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr)); 72 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr));
73 const auto urls = config->UpdateUrl(); 73 const auto urls = config->UpdateUrl();
74 74
75 // Expect the default url to be cryptographically secure. 75 // Expect the default url to be cryptographically secure.
76 EXPECT_GE(urls.size(), 1u); 76 EXPECT_GE(urls.size(), 1u);
77 EXPECT_TRUE(urls.front().SchemeIsCryptographic()); 77 EXPECT_TRUE(urls.front().SchemeIsCryptographic());
78 } 78 }
79 79
80 TEST(ChromeComponentUpdaterConfiguratorTest, TestUseCupSigning) { 80 TEST(ChromeComponentUpdaterConfiguratorTest, TestEnabledCupSigning) {
81 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); 81 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess());
82 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr)); 82 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr));
83 83
84 EXPECT_TRUE(config->UseCupSigning()); 84 EXPECT_TRUE(config->EnabledCupSigning());
85 } 85 }
86 86
87 TEST(ChromeComponentUpdaterConfiguratorTest, TestUseEncryption) { 87 TEST(ChromeComponentUpdaterConfiguratorTest, TestUseEncryption) {
88 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); 88 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
89 const auto config(MakeChromeComponentUpdaterConfigurator(cmdline, nullptr)); 89 const auto config(MakeChromeComponentUpdaterConfigurator(cmdline, nullptr));
90 90
91 const auto urls = config->UpdateUrl(); 91 const auto urls = config->UpdateUrl();
92 ASSERT_EQ(2u, urls.size()); 92 ASSERT_EQ(2u, urls.size());
93 ASSERT_STREQ(kUpdaterDefaultUrl, urls[0].spec().c_str()); 93 ASSERT_STREQ(kUpdaterDefaultUrl, urls[0].spec().c_str());
94 ASSERT_STREQ(kUpdaterFallbackUrl, urls[1].spec().c_str()); 94 ASSERT_STREQ(kUpdaterFallbackUrl, urls[1].spec().c_str());
(...skipping 13 matching lines...) Expand all
108 { 108 {
109 const ConfiguratorImpl config(cmdline, nullptr, false); 109 const ConfiguratorImpl config(cmdline, nullptr, false);
110 const auto urls = config.UpdateUrl(); 110 const auto urls = config.UpdateUrl();
111 ASSERT_EQ(2u, urls.size()); 111 ASSERT_EQ(2u, urls.size());
112 ASSERT_STREQ(kUpdaterDefaultUrl, urls[0].spec().c_str()); 112 ASSERT_STREQ(kUpdaterDefaultUrl, urls[0].spec().c_str());
113 ASSERT_STREQ(kUpdaterFallbackUrl, urls[1].spec().c_str()); 113 ASSERT_STREQ(kUpdaterFallbackUrl, urls[1].spec().c_str());
114 ASSERT_EQ(config.UpdateUrl(), config.PingUrl()); 114 ASSERT_EQ(config.UpdateUrl(), config.PingUrl());
115 } 115 }
116 } 116 }
117 117
118 TEST(ChromeComponentUpdaterConfiguratorTest, TestEnabledComponentUpdates) {
119 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess());
120 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr));
121 EXPECT_TRUE(config->EnabledComponentUpdates());
122 }
123
118 } // namespace component_updater 124 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698