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 <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 Loading... |
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 |
OLD | NEW |