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

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

Issue 12091115: Allow manifest handlers to declare keys they depend on that must be parsed before them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcronin 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
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 "chrome/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 EXPECT_FALSE(extension); 119 EXPECT_FALSE(extension);
120 EXPECT_EQ(expected_error, error); 120 EXPECT_EQ(expected_error, error);
121 } 121 }
122 122
123 } 123 }
124 124
125 class ExtensionTest : public testing::Test { 125 class ExtensionTest : public testing::Test {
126 protected: 126 protected:
127 virtual void SetUp() OVERRIDE { 127 virtual void SetUp() OVERRIDE {
128 ManifestHandler::Register(extension_manifest_keys::kCommands, 128 ManifestHandler::Register(extension_manifest_keys::kCommands,
129 new CommandsHandler); 129 make_linked_ptr(new CommandsHandler));
130 } 130 }
131 }; 131 };
132 132
133 // We persist location values in the preferences, so this is a sanity test that 133 // We persist location values in the preferences, so this is a sanity test that
134 // someone doesn't accidentally change them. 134 // someone doesn't accidentally change them.
135 TEST_F(ExtensionTest, LocationValuesTest) { 135 TEST_F(ExtensionTest, LocationValuesTest) {
136 ASSERT_EQ(0, Manifest::INVALID_LOCATION); 136 ASSERT_EQ(0, Manifest::INVALID_LOCATION);
137 ASSERT_EQ(1, Manifest::INTERNAL); 137 ASSERT_EQ(1, Manifest::INTERNAL);
138 ASSERT_EQ(2, Manifest::EXTERNAL_PREF); 138 ASSERT_EQ(2, Manifest::EXTERNAL_PREF);
139 ASSERT_EQ(3, Manifest::EXTERNAL_REGISTRY); 139 ASSERT_EQ(3, Manifest::EXTERNAL_REGISTRY);
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 scoped_refptr<Extension> extension( 1292 scoped_refptr<Extension> extension(
1293 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), 1293 MakeSyncTestExtension(EXTENSION, GURL(), GURL(),
1294 Manifest::INTERNAL, 2, FilePath(), 1294 Manifest::INTERNAL, 2, FilePath(),
1295 Extension::NO_FLAGS)); 1295 Extension::NO_FLAGS));
1296 if (extension) 1296 if (extension)
1297 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); 1297 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE);
1298 } 1298 }
1299 #endif // !defined(OS_CHROMEOS) 1299 #endif // !defined(OS_CHROMEOS)
1300 1300
1301 } // namespace extensions 1301 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_file_util_unittest.cc ('k') | chrome/common/extensions/manifest_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698