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

Side by Side Diff: extensions/browser/sandboxed_unpacker_unittest.cc

Issue 2788563002: Transfer DictionaryValue ownership in SandboxedUnpacker::OnUnpackSuccess() (Closed)
Patch Set: address comments Created 3 years, 8 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
« no previous file with comments | « extensions/browser/sandboxed_unpacker.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "extensions/browser/sandboxed_unpacker.h" 5 #include "extensions/browser/sandboxed_unpacker.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 base::FilePath temp_dir() const { return temp_dir_; } 40 base::FilePath temp_dir() const { return temp_dir_; }
41 base::string16 unpack_err() const { return error_; } 41 base::string16 unpack_err() const { return error_; }
42 42
43 private: 43 private:
44 ~MockSandboxedUnpackerClient() override {} 44 ~MockSandboxedUnpackerClient() override {}
45 45
46 void OnUnpackSuccess(const base::FilePath& temp_dir, 46 void OnUnpackSuccess(const base::FilePath& temp_dir,
47 const base::FilePath& extension_root, 47 const base::FilePath& extension_root,
48 const base::DictionaryValue* original_manifest, 48 std::unique_ptr<base::DictionaryValue> original_manifest,
49 const Extension* extension, 49 const Extension* extension,
50 const SkBitmap& install_icon) override { 50 const SkBitmap& install_icon) override {
51 temp_dir_ = temp_dir; 51 temp_dir_ = temp_dir;
52 quit_closure_.Run(); 52 quit_closure_.Run();
53 } 53 }
54 54
55 void OnUnpackFailure(const CrxInstallError& error) override { 55 void OnUnpackFailure(const CrxInstallError& error) override {
56 error_ = error.message(); 56 error_ = error.message();
57 quit_closure_.Run(); 57 quit_closure_.Run();
58 } 58 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 EXPECT_EQ(base::string16(), GetInstallError()); 183 EXPECT_EQ(base::string16(), GetInstallError());
184 } 184 }
185 185
186 TEST_F(SandboxedUnpackerTest, SkipHashCheck) { 186 TEST_F(SandboxedUnpackerTest, SkipHashCheck) {
187 SetupUnpacker("good_l10n.crx", "badhash"); 187 SetupUnpacker("good_l10n.crx", "badhash");
188 // Check that there is no error message. 188 // Check that there is no error message.
189 EXPECT_EQ(base::string16(), GetInstallError()); 189 EXPECT_EQ(base::string16(), GetInstallError());
190 } 190 }
191 191
192 } // namespace extensions 192 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/sandboxed_unpacker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698