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

Side by Side Diff: components/update_client/component_unpacker_unittest.cc

Issue 2874503002: Refactor CRX verification in preparation to support CRX₃ files. (Closed)
Patch Set: through #51 Created 3 years, 7 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 <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Tests a mismatch between the public key hash and the id of the component. 152 // Tests a mismatch between the public key hash and the id of the component.
153 TEST_F(ComponentUnpackerTest, UnpackFileHashMismatch) { 153 TEST_F(ComponentUnpackerTest, UnpackFileHashMismatch) {
154 scoped_refptr<ComponentUnpacker> component_unpacker = new ComponentUnpacker( 154 scoped_refptr<ComponentUnpacker> component_unpacker = new ComponentUnpacker(
155 std::vector<uint8_t>(std::begin(abag_hash), std::end(abag_hash)), 155 std::vector<uint8_t>(std::begin(abag_hash), std::end(abag_hash)),
156 test_file("jebgalgnebhfojomionfpkfelancnnkf.crx"), nullptr, nullptr, 156 test_file("jebgalgnebhfojomionfpkfelancnnkf.crx"), nullptr, nullptr,
157 config_->GetSequencedTaskRunner()); 157 config_->GetSequencedTaskRunner());
158 component_unpacker->Unpack(base::Bind(&ComponentUnpackerTest::UnpackComplete, 158 component_unpacker->Unpack(base::Bind(&ComponentUnpackerTest::UnpackComplete,
159 base::Unretained(this))); 159 base::Unretained(this)));
160 RunThreads(); 160 RunThreads();
161 161
162 EXPECT_EQ(UnpackerError::kInvalidId, result_.error); 162 EXPECT_EQ(UnpackerError::kInvalidFile, result_.error);
163 EXPECT_EQ(0, result_.extended_error); 163 EXPECT_EQ(0, result_.extended_error);
164 164
165 EXPECT_TRUE(result_.unpack_path.empty()); 165 EXPECT_TRUE(result_.unpack_path.empty());
166 } 166 }
167 167
168 } // namespace update_client 168 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/component_unpacker.cc ('k') | components/update_client/update_client_errors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698