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

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

Issue 12093036: Move Extension Location and Type enums to Manifest, and move InstallWarning to its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/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
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/values.h" 5 #include "base/values.h"
6 #include "chrome/common/extensions/extension.h" 6 #include "chrome/common/extensions/extension.h"
7 #include "chrome/common/extensions/extension_manifest_constants.h" 7 #include "chrome/common/extensions/extension_manifest_constants.h"
8 #include "chrome/common/extensions/extension_test_util.h" 8 #include "chrome/common/extensions/extension_test_util.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 using extensions::Extension; 11 using extensions::Extension;
12 12
13 namespace extension_test_util { 13 namespace extension_test_util {
14 14
15 std::string MakeId(std::string seed) { 15 std::string MakeId(std::string seed) {
16 std::string result; 16 std::string result;
17 bool success = Extension::GenerateId(seed, &result); 17 bool success = Extension::GenerateId(seed, &result);
18 EXPECT_TRUE(success); 18 EXPECT_TRUE(success);
19 EXPECT_FALSE(result.empty()); 19 EXPECT_FALSE(result.empty());
20 EXPECT_TRUE(Extension::IdIsValid(result)); 20 EXPECT_TRUE(Extension::IdIsValid(result));
21 return result; 21 return result;
22 } 22 }
23 23
24 scoped_refptr<Extension> CreateExtensionWithID(std::string id) { 24 scoped_refptr<Extension> CreateExtensionWithID(std::string id) {
25 DictionaryValue values; 25 DictionaryValue values;
26 values.SetString(extension_manifest_keys::kName, "test"); 26 values.SetString(extension_manifest_keys::kName, "test");
27 values.SetString(extension_manifest_keys::kVersion, "0.1"); 27 values.SetString(extension_manifest_keys::kVersion, "0.1");
28 std::string error; 28 std::string error;
29 return Extension::Create(FilePath(), Extension::INTERNAL, values, 29 return Extension::Create(FilePath(), extensions::Manifest::INTERNAL, values,
30 Extension::NO_FLAGS, id, &error); 30 Extension::NO_FLAGS, id, &error);
31 } 31 }
32 32
33 } // namespace extension_test_util 33 } // namespace extension_test_util
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_set_unittest.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698