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

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: No subclass 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // Tests a mismatch between the public key hash and the id of the component. 153 // Tests a mismatch between the public key hash and the id of the component.
154 TEST_F(ComponentUnpackerTest, UnpackFileHashMismatch) { 154 TEST_F(ComponentUnpackerTest, UnpackFileHashMismatch) {
155 scoped_refptr<ComponentUnpacker> component_unpacker = new ComponentUnpacker( 155 scoped_refptr<ComponentUnpacker> component_unpacker = new ComponentUnpacker(
156 std::vector<uint8_t>(std::begin(abag_hash), std::end(abag_hash)), 156 std::vector<uint8_t>(std::begin(abag_hash), std::end(abag_hash)),
157 test_file("jebgalgnebhfojomionfpkfelancnnkf.crx"), nullptr, nullptr, 157 test_file("jebgalgnebhfojomionfpkfelancnnkf.crx"), nullptr, nullptr,
158 config_->GetSequencedTaskRunner()); 158 config_->GetSequencedTaskRunner());
159 component_unpacker->Unpack(base::Bind(&ComponentUnpackerTest::UnpackComplete, 159 component_unpacker->Unpack(base::Bind(&ComponentUnpackerTest::UnpackComplete,
160 base::Unretained(this))); 160 base::Unretained(this)));
161 RunThreads(); 161 RunThreads();
162 162
163 EXPECT_EQ(UnpackerError::kInvalidId, result_.error); 163 EXPECT_EQ(UnpackerError::kInvalidFile, result_.error);
164 EXPECT_EQ(0, result_.extended_error); 164 EXPECT_EQ(0, result_.extended_error);
165 165
166 EXPECT_TRUE(result_.unpack_path.empty()); 166 EXPECT_TRUE(result_.unpack_path.empty());
167 } 167 }
168 168
169 } // namespace update_client 169 } // namespace update_client
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698