summaryrefslogtreecommitdiffstats
path: root/extensions/common/test_util.cc
diff options
context:
space:
mode:
authorjamescook <jamescook@chromium.org>2014-09-16 21:05:10 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-17 04:05:20 +0000
commitf79df3346ce523b2c44c7d99e0b819788c432203 (patch)
treee23b3c8901069867ee43fb42e07bff0ecc74df91 /extensions/common/test_util.cc
parent0c0930e5a6d6ca2921f6121f20d5de7604af3e5a (diff)
downloadchromium_src-f79df3346ce523b2c44c7d99e0b819788c432203.zip
chromium_src-f79df3346ce523b2c44c7d99e0b819788c432203.tar.gz
chromium_src-f79df3346ce523b2c44c7d99e0b819788c432203.tar.bz2
Reland: Refactor ExtensionManifestTest to allow usage in src/extensions
Original CL broke the Win official bots because they report their default version channel as "canary" instead of "trunk". https://codereview.chromium.org/572813002 Original description: This refactor will allow some manifest tests running in Chrome's unit_tests suite to move to the extensions_unittests suite. * Rename ExtensionManifestTest to extensions::ManifestTest and move it into src/extensions. * Introduce ChromeManifestTest to load manifests from Chrome's test data dir. * Eliminate some unnecessary use of chrome::VersionInfo::Channel. * Move SharedModuleManifestTest to extensions_unittests as an example. FileHandlerManifestTest and ExternallyConnectableManifestTest will be next, but require more refactoring (e.g. of permissions). BUG=397165 TEST=unit_tests, extensions_unittests TBR=rockot@chromium.org Review URL: https://codereview.chromium.org/574173002 Cr-Commit-Position: refs/heads/master@{#295225}
Diffstat (limited to 'extensions/common/test_util.cc')
-rw-r--r--extensions/common/test_util.cc19
1 files changed, 0 insertions, 19 deletions
diff --git a/extensions/common/test_util.cc b/extensions/common/test_util.cc
index 03b35b8..4eacfa6 100644
--- a/extensions/common/test_util.cc
+++ b/extensions/common/test_util.cc
@@ -4,12 +4,9 @@
#include "extensions/common/test_util.h"
-#include "base/json/json_reader.h"
-#include "base/values.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/value_builder.h"
-#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
namespace test_util {
@@ -39,21 +36,5 @@ scoped_refptr<Extension> CreateExtensionWithID(const std::string& id) {
.Build();
}
-scoped_ptr<base::DictionaryValue> ParseJsonDictionaryWithSingleQuotes(
- std::string json) {
- std::replace(json.begin(), json.end(), '\'', '"');
- std::string error_msg;
- scoped_ptr<base::Value> result(base::JSONReader::ReadAndReturnError(
- json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error_msg));
- scoped_ptr<base::DictionaryValue> result_dict;
- if (result && result->IsType(base::Value::TYPE_DICTIONARY)) {
- result_dict.reset(static_cast<base::DictionaryValue*>(result.release()));
- } else {
- ADD_FAILURE() << "Failed to parse \"" << json << "\": " << error_msg;
- result_dict.reset(new base::DictionaryValue());
- }
- return result_dict.Pass();
-}
-
} // namespace test_util
} // namespace extensions