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

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: Latest master for cq Created 8 years, 5 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
« no previous file with comments | « chrome/common/extensions/extension_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b2141d72c16e7ecc602e6ba850cc3625d03e7979 100644
--- a/chrome/common/extensions/extension_test_util.cc
+++ b/chrome/common/extensions/extension_test_util.cc
@@ -2,19 +2,32 @@
// 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> CreateExtensionWithID(std::string id) {
+ DictionaryValue values;
+ values.SetString(extension_manifest_keys::kName, "test");
+ values.SetString(extension_manifest_keys::kVersion, "0.1");
+ std::string error;
+ return Extension::Create(FilePath(), Extension::INTERNAL, values,
+ Extension::NO_FLAGS, id, &error);
+}
+
} // namespace extension_test_util
« no previous file with comments | « chrome/common/extensions/extension_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698