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

Side by Side Diff: components/component_updater/default_component_installer_unittest.cc

Issue 2154773002: Implement Just-In-Time Flash updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git pull && gclient sync 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 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 <utility>
7 #include <vector> 8 #include <vector>
8 9
9 #include "base/callback.h" 10 #include "base/callback.h"
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
13 #include "base/run_loop.h" 14 #include "base/run_loop.h"
14 #include "base/test/sequenced_worker_pool_owner.h" 15 #include "base/test/sequenced_worker_pool_owner.h"
15 #include "base/version.h" 16 #include "base/version.h"
16 #include "components/component_updater/component_updater_service.h" 17 #include "components/component_updater/component_updater_service.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 96
96 std::string GetName() const override { return "fake name"; } 97 std::string GetName() const override { return "fake name"; }
97 98
98 update_client::InstallerAttributes GetInstallerAttributes() const override { 99 update_client::InstallerAttributes GetInstallerAttributes() const override {
99 update_client::InstallerAttributes installer_attributes; 100 update_client::InstallerAttributes installer_attributes;
100 installer_attributes["ap"] = "fake-ap"; 101 installer_attributes["ap"] = "fake-ap";
101 installer_attributes["is-enterprise"] = "1"; 102 installer_attributes["is-enterprise"] = "1";
102 return installer_attributes; 103 return installer_attributes;
103 } 104 }
104 105
106 std::vector<std::string> GetMimeTypes() const override {
107 return std::vector<std::string>();
108 }
109
105 private: 110 private:
106 static void GetPkHash(std::vector<uint8_t>* hash) { 111 static void GetPkHash(std::vector<uint8_t>* hash) {
107 hash->assign(std::begin(kSha256Hash), std::end(kSha256Hash)); 112 hash->assign(std::begin(kSha256Hash), std::end(kSha256Hash));
108 } 113 }
109 }; 114 };
110 115
111 class DefaultComponentInstallerTest : public testing::Test { 116 class DefaultComponentInstallerTest : public testing::Test {
112 public: 117 public:
113 DefaultComponentInstallerTest(); 118 DefaultComponentInstallerTest();
114 ~DefaultComponentInstallerTest() override; 119 ~DefaultComponentInstallerTest() override;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 std::vector<uint8_t>(std::begin(kSha256Hash), std::end(kSha256Hash)), 222 std::vector<uint8_t>(std::begin(kSha256Hash), std::end(kSha256Hash)),
218 component.pk_hash); 223 component.pk_hash);
219 EXPECT_EQ(base::Version("0.0.0.0"), component.version); 224 EXPECT_EQ(base::Version("0.0.0.0"), component.version);
220 EXPECT_TRUE(component.fingerprint.empty()); 225 EXPECT_TRUE(component.fingerprint.empty());
221 EXPECT_STREQ("fake name", component.name.c_str()); 226 EXPECT_STREQ("fake name", component.name.c_str());
222 EXPECT_EQ(expected_attrs, component.installer_attributes); 227 EXPECT_EQ(expected_attrs, component.installer_attributes);
223 EXPECT_TRUE(component.requires_network_encryption); 228 EXPECT_TRUE(component.requires_network_encryption);
224 } 229 }
225 230
226 } // namespace component_updater 231 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698