summaryrefslogtreecommitdiffstats
path: root/extensions/common/test_util.h
diff options
context:
space:
mode:
authorscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-06 20:52:32 +0000
committerscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-06 20:52:32 +0000
commit98e1617bfcaaffb9aa9e39cd7bd44831f6f5d376 (patch)
tree829c19e53e7535388f9100232803de0ed113d893 /extensions/common/test_util.h
parente6fc7b45877afd0ca10d139f936af8caf529b3c0 (diff)
downloadchromium_src-98e1617bfcaaffb9aa9e39cd7bd44831f6f5d376.zip
chromium_src-98e1617bfcaaffb9aa9e39cd7bd44831f6f5d376.tar.gz
chromium_src-98e1617bfcaaffb9aa9e39cd7bd44831f6f5d376.tar.bz2
Parse manifest file with app.service_worker.script.
Add parsing logic to load a manifest specifying a service worker script. This is a precursor to registering and using that script. BUG=344917 R=jyasskin@chromium.org Review URL: https://codereview.chromium.org/178253007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/test_util.h')
-rw-r--r--extensions/common/test_util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/extensions/common/test_util.h b/extensions/common/test_util.h
index e38b28f..54d985b 100644
--- a/extensions/common/test_util.h
+++ b/extensions/common/test_util.h
@@ -8,6 +8,11 @@
#include <string>
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class DictionaryValue;
+} // namespace base
namespace extensions {
class Extension;
@@ -21,6 +26,12 @@ ExtensionBuilder& BuildExtension(ExtensionBuilder& builder);
// Return a very simple extension with a given |id|.
scoped_refptr<Extension> CreateExtensionWithID(const std::string& id);
+// Parses |json| allowing trailing commas and replacing single quotes with
+// double quotes for test readability. If the json fails to parse, calls gtest's
+// ADD_FAILURE and returns an empty dictionary.
+scoped_ptr<base::DictionaryValue> ParseJsonDictionaryWithSingleQuotes(
+ std::string json);
+
} // namespace test_util
} // namespace extensions