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

Unified Diff: chrome/common/extensions/manifest_tests/extension_manifest_test.h

Issue 178253007: Parse manifest file with app.service_worker.script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved test utils out of base Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/manifest_tests/extension_manifest_test.h
diff --git a/chrome/common/extensions/manifest_tests/extension_manifest_test.h b/chrome/common/extensions/manifest_tests/extension_manifest_test.h
index d7169437cb4fb525a8747fef933662ee83ea04d7..6d68cf9d5b7c157b3a03bb4f55c263fa9faa037c 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifest_test.h
+++ b/chrome/common/extensions/manifest_tests/extension_manifest_test.h
@@ -24,6 +24,7 @@ class ExtensionManifestTest : public testing::Test {
public:
explicit Manifest(const char* name);
Manifest(base::DictionaryValue* manifest, const char* name);
+ explicit Manifest(scoped_ptr<base::DictionaryValue> manifest);
// C++98 requires the copy constructor for a type to be visible if you
// take a const-ref of a temporary for that type. Since Manifest
// contains a scoped_ptr, its implicit copy constructor is declared
@@ -74,6 +75,11 @@ class ExtensionManifestTest : public testing::Test {
extensions::Manifest::INTERNAL,
int flags = extensions::Extension::NO_FLAGS);
+ // Load and expect success from a manifest provided as a json string. Single
+ // quotes will be replaced with double quotes for test readability.
+ scoped_refptr<extensions::Extension> LoadFromStringAndExpectSuccess(
+ char const* manifest_json);
+
scoped_refptr<extensions::Extension> LoadAndExpectWarning(
const Manifest& manifest,
const std::string& expected_error,
@@ -105,6 +111,11 @@ class ExtensionManifestTest : public testing::Test {
extensions::Manifest::INTERNAL,
int flags = extensions::Extension::NO_FLAGS);
+ // Load and expect an error from a manifest provided as a json string. Single
+ // quotes will be replaced with double quotes for test readability.
+ void LoadFromStringAndExpectError(char const* manifest_json,
+ const std::string& expected_error);
+
void AddPattern(extensions::URLPatternSet* extent,
const std::string& pattern);

Powered by Google App Engine
This is Rietveld 408576698