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

Side by Side Diff: chrome/common/extensions/unpacker_unittest.cc

Issue 12226045: Linux/ChromeOS Chromium style checker cleanup, chrome/ edition part 1. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/json_schema_validator_unittest.cc » ('j') | 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/files/scoped_temp_dir.h" 6 #include "base/files/scoped_temp_dir.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/common/chrome_paths.h" 11 #include "chrome/common/chrome_paths.h"
12 #include "chrome/common/extensions/api/i18n/default_locale_handler.h" 12 #include "chrome/common/extensions/api/i18n/default_locale_handler.h"
13 #include "chrome/common/extensions/extension.h" 13 #include "chrome/common/extensions/extension.h"
14 #include "chrome/common/extensions/extension_constants.h" 14 #include "chrome/common/extensions/extension_constants.h"
15 #include "chrome/common/extensions/extension_manifest_constants.h" 15 #include "chrome/common/extensions/extension_manifest_constants.h"
16 #include "chrome/common/extensions/manifest_handler.h" 16 #include "chrome/common/extensions/manifest_handler.h"
17 #include "chrome/common/extensions/unpacker.h" 17 #include "chrome/common/extensions/unpacker.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 #include "third_party/skia/include/core/SkBitmap.h" 19 #include "third_party/skia/include/core/SkBitmap.h"
20 20
21 namespace errors = extension_manifest_errors; 21 namespace errors = extension_manifest_errors;
22 namespace filenames = extension_filenames; 22 namespace filenames = extension_filenames;
23 namespace keys = extension_manifest_keys; 23 namespace keys = extension_manifest_keys;
24 24
25 namespace extensions { 25 namespace extensions {
26 26
27 class UnpackerTest : public testing::Test { 27 class UnpackerTest : public testing::Test {
28 public: 28 public:
29 ~UnpackerTest() { 29 virtual ~UnpackerTest() {
30 LOG(WARNING) << "Deleting temp dir: " 30 LOG(WARNING) << "Deleting temp dir: "
31 << temp_dir_.path().LossyDisplayName(); 31 << temp_dir_.path().LossyDisplayName();
32 LOG(WARNING) << temp_dir_.Delete(); 32 LOG(WARNING) << temp_dir_.Delete();
33 } 33 }
34 34
35 virtual void SetUp() OVERRIDE { 35 virtual void SetUp() OVERRIDE {
36 testing::Test::SetUp(); 36 testing::Test::SetUp();
37 extensions::ManifestHandler::Register( 37 extensions::ManifestHandler::Register(
38 keys::kDefaultLocale, 38 keys::kDefaultLocale,
39 make_linked_ptr(new extensions::DefaultLocaleHandler)); 39 make_linked_ptr(new extensions::DefaultLocaleHandler));
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 SetupUnpacker("bad_image.crx"); 272 SetupUnpacker("bad_image.crx");
273 EXPECT_FALSE(unpacker_->Run()); 273 EXPECT_FALSE(unpacker_->Run());
274 EXPECT_TRUE(StartsWith(unpacker_->error_message(), 274 EXPECT_TRUE(StartsWith(unpacker_->error_message(),
275 ASCIIToUTF16(kExpected), 275 ASCIIToUTF16(kExpected),
276 false)) << "Expected prefix: \"" << kExpected 276 false)) << "Expected prefix: \"" << kExpected
277 << "\", actual error: \"" << unpacker_->error_message() 277 << "\", actual error: \"" << unpacker_->error_message()
278 << "\""; 278 << "\"";
279 } 279 }
280 280
281 } // namespace extensions 281 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/common/json_schema_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698