Chromium Code Reviews| 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 <iterator> | 5 #include <iterator> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 | 95 |
| 96 std::string GetName() const override { return "fake name"; } | 96 std::string GetName() const override { return "fake name"; } |
| 97 | 97 |
| 98 update_client::InstallerAttributes GetInstallerAttributes() const override { | 98 update_client::InstallerAttributes GetInstallerAttributes() const override { |
| 99 update_client::InstallerAttributes installer_attributes; | 99 update_client::InstallerAttributes installer_attributes; |
| 100 installer_attributes["ap"] = "fake-ap"; | 100 installer_attributes["ap"] = "fake-ap"; |
| 101 installer_attributes["is-enterprise"] = "1"; | 101 installer_attributes["is-enterprise"] = "1"; |
| 102 return installer_attributes; | 102 return installer_attributes; |
| 103 } | 103 } |
| 104 | 104 |
| 105 void AddMimeTypes(std::vector<std::string>* mime_types) const override {} | |
| 106 | |
|
Bernhard Bauer
2016/07/28 10:25:10
Nit: remove one empty line.
waffles
2016/07/28 20:06:27
Done.
| |
| 107 | |
| 105 private: | 108 private: |
| 106 static void GetPkHash(std::vector<uint8_t>* hash) { | 109 static void GetPkHash(std::vector<uint8_t>* hash) { |
| 107 hash->assign(std::begin(kSha256Hash), std::end(kSha256Hash)); | 110 hash->assign(std::begin(kSha256Hash), std::end(kSha256Hash)); |
| 108 } | 111 } |
| 109 }; | 112 }; |
| 110 | 113 |
| 111 class DefaultComponentInstallerTest : public testing::Test { | 114 class DefaultComponentInstallerTest : public testing::Test { |
| 112 public: | 115 public: |
| 113 DefaultComponentInstallerTest(); | 116 DefaultComponentInstallerTest(); |
| 114 ~DefaultComponentInstallerTest() override; | 117 ~DefaultComponentInstallerTest() override; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 std::vector<uint8_t>(std::begin(kSha256Hash), std::end(kSha256Hash)), | 220 std::vector<uint8_t>(std::begin(kSha256Hash), std::end(kSha256Hash)), |
| 218 component.pk_hash); | 221 component.pk_hash); |
| 219 EXPECT_EQ(base::Version("0.0.0.0"), component.version); | 222 EXPECT_EQ(base::Version("0.0.0.0"), component.version); |
| 220 EXPECT_TRUE(component.fingerprint.empty()); | 223 EXPECT_TRUE(component.fingerprint.empty()); |
| 221 EXPECT_STREQ("fake name", component.name.c_str()); | 224 EXPECT_STREQ("fake name", component.name.c_str()); |
| 222 EXPECT_EQ(expected_attrs, component.installer_attributes); | 225 EXPECT_EQ(expected_attrs, component.installer_attributes); |
| 223 EXPECT_TRUE(component.requires_network_encryption); | 226 EXPECT_TRUE(component.requires_network_encryption); |
| 224 } | 227 } |
| 225 | 228 |
| 226 } // namespace component_updater | 229 } // namespace component_updater |
| OLD | NEW |