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

Unified Diff: chrome/common/extensions/permissions/permission_set_unittest.cc

Issue 14358004: Almost all actions in Declarative Web Request require all_urls host permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: All URLs -> all hosts; also rebased Created 7 years, 8 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/permissions/permission_set_unittest.cc
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index 73cef129915c7c6cdeaa0dbbf6ce50893adc0b39..2b9918780656a2dc36e9fd57d0dd74857d56923e 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -11,6 +11,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/plugins/plugins_handler.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/extension_test_util.h"
#include "chrome/common/extensions/extension_unittest.h"
#include "chrome/common/extensions/features/feature.h"
#include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h"
@@ -20,39 +21,12 @@
#include "extensions/common/error_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
+using extension_test_util::LoadManifest;
+
namespace extensions {
namespace {
-scoped_refptr<Extension> LoadManifest(const std::string& dir,
- const std::string& test_file,
- int extra_flags) {
- base::FilePath path;
- PathService::Get(chrome::DIR_TEST_DATA, &path);
- path = path.AppendASCII("extensions")
- .AppendASCII(dir)
- .AppendASCII(test_file);
-
- JSONFileValueSerializer serializer(path);
- std::string error;
- scoped_ptr<Value> result(serializer.Deserialize(NULL, &error));
- if (!result.get()) {
- EXPECT_EQ("", error);
- return NULL;
- }
-
- scoped_refptr<Extension> extension = Extension::Create(
- path.DirName(), Manifest::INVALID_LOCATION,
- *static_cast<DictionaryValue*>(result.get()), extra_flags, &error);
- EXPECT_TRUE(extension) << error;
- return extension;
-}
-
-scoped_refptr<Extension> LoadManifest(const std::string& dir,
- const std::string& test_file) {
- return LoadManifest(dir, test_file, Extension::NO_FLAGS);
-}
-
static void AddPattern(URLPatternSet* extent, const std::string& pattern) {
int schemes = URLPattern::SCHEME_ALL;
extent->AddPattern(URLPattern(schemes, pattern));
« no previous file with comments | « chrome/common/extensions/extension_unittest.cc ('k') | chrome/test/data/extensions/api_test/declarative/api/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698