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

Unified Diff: chrome/browser/extensions/extension_function_test_utils.cc

Issue 10697017: Tabs Extension: Implementation of tabs.duplicate api. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 3 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/browser/extensions/extension_function_test_utils.cc
===================================================================
--- chrome/browser/extensions/extension_function_test_utils.cc (revision 155137)
+++ chrome/browser/extensions/extension_function_test_utils.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/file_path.h"
#include "base/json/json_reader.h"
#include "base/values.h"
+#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
#include "chrome/browser/ui/browser.h"
@@ -18,6 +19,7 @@
using content::WebContents;
using extensions::Extension;
+namespace keys = extensions::tabs_constants;
namespace {
@@ -105,20 +107,40 @@
scoped_refptr<Extension> CreateEmptyExtensionWithLocation(
Extension::Location location) {
+ scoped_ptr<base::DictionaryValue> test_extension_value(
+ ParseDictionary("{\"name\": \"Test\", \"version\": \"1.0\"}"));
+ return CreateExtension(location, test_extension_value.get());
+}
+
+scoped_refptr<Extension> CreateExtension(
+ base::DictionaryValue* test_extension_value) {
+ return CreateExtension(Extension::INTERNAL, test_extension_value);
+}
+
+scoped_refptr<Extension> CreateExtension(
+ Extension::Location location,
+ base::DictionaryValue* test_extension_value) {
std::string error;
const FilePath test_extension_path;
- scoped_ptr<base::DictionaryValue> test_extension_value(
- ParseDictionary("{\"name\": \"Test\", \"version\": \"1.0\"}"));
scoped_refptr<Extension> extension(Extension::Create(
test_extension_path,
location,
- *test_extension_value.get(),
+ *test_extension_value,
Extension::NO_FLAGS,
&error));
EXPECT_TRUE(error.empty()) << "Could not parse test extension " << error;
return extension;
}
+bool HasPrivacySensitiveFields(base::DictionaryValue* val) {
+ std::string result;
+ if (val->GetString(keys::kUrlKey, &result) ||
+ val->GetString(keys::kTitleKey, &result) ||
+ val->GetString(keys::kFaviconUrlKey, &result))
+ return true;
+ return false;
+}
+
std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function,
const std::string& args,
Browser* browser) {
« no previous file with comments | « chrome/browser/extensions/extension_function_test_utils.h ('k') | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698