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

Unified Diff: chrome/common/extensions/extension_test_util.cc

Issue 10694056: CPM Extension Uninstall Watching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension_test_util.cc
diff --git a/chrome/common/extensions/extension_test_util.cc b/chrome/common/extensions/extension_test_util.cc
index fc6562f8534a7cf50c87bb64c030e672c5294e86..8a067bc185f042a12d7f40de8eb6af2dfdaf8910 100644
--- a/chrome/common/extensions/extension_test_util.cc
+++ b/chrome/common/extensions/extension_test_util.cc
@@ -2,19 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/values.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/extension_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
+using extensions::Extension;
+
namespace extension_test_util {
std::string MakeId(std::string seed) {
std::string result;
- bool success = extensions::Extension::GenerateId(seed, &result);
+ bool success = Extension::GenerateId(seed, &result);
EXPECT_TRUE(success);
EXPECT_FALSE(result.empty());
- EXPECT_TRUE(extensions::Extension::IdIsValid(result));
+ EXPECT_TRUE(Extension::IdIsValid(result));
return result;
}
+scoped_refptr<Extension> CreateExtension(std::string id) {
+ DictionaryValue values;
+ values.SetString(extension_manifest_keys::kName, "test");
+ values.SetString(extension_manifest_keys::kVersion, "0.1");
+ std::string error;
+ return id.empty() ?
+ Extension::Create(FilePath(), Extension::INTERNAL, values,
Yoyo Zhou 2012/07/09 17:06:37 This is not needed.
Devlin 2012/07/09 20:48:26 Done.
+ Extension::NO_FLAGS, &error) :
+ Extension::Create(FilePath(), Extension::INTERNAL, values,
+ Extension::NO_FLAGS, id, &error);
+}
+
} // namespace extension_test_util

Powered by Google App Engine
This is Rietveld 408576698