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

Unified Diff: chrome/browser/extensions/api/declarative_content/content_action_unittest.cc

Issue 822453002: Introduce HostID and de-couple Extensions from "script injection System" [browser side] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 11 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/api/declarative_content/content_action_unittest.cc
diff --git a/chrome/browser/extensions/api/declarative_content/content_action_unittest.cc b/chrome/browser/extensions/api/declarative_content/content_action_unittest.cc
index a593a9b5c68d245c3c29651db902d3bab872afbd..4f1fd1802f8ddc303c448b0104017f2e621d9844 100644
--- a/chrome/browser/extensions/api/declarative_content/content_action_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_content/content_action_unittest.cc
@@ -73,7 +73,7 @@ TEST(DeclarativeContentActionTest, InvalidCreation) {
// Test wrong data type passed.
error.clear();
result = ContentAction::Create(
- NULL, NULL, *ParseJson("[]"), &error, &bad_message);
+ NULL, HostID(), NULL, *ParseJson("[]"), &error, &bad_message);
EXPECT_TRUE(bad_message);
EXPECT_EQ("", error);
EXPECT_FALSE(result.get());
@@ -81,14 +81,14 @@ TEST(DeclarativeContentActionTest, InvalidCreation) {
// Test missing instanceType element.
error.clear();
result = ContentAction::Create(
- NULL, NULL, *ParseJson("{}"), &error, &bad_message);
+ NULL, HostID(), NULL, *ParseJson("{}"), &error, &bad_message);
EXPECT_TRUE(bad_message);
EXPECT_EQ("", error);
EXPECT_FALSE(result.get());
// Test wrong instanceType element.
error.clear();
- result = ContentAction::Create(NULL, NULL, *ParseJson(
+ result = ContentAction::Create(NULL, HostID(), NULL, *ParseJson(
"{\n"
" \"instanceType\": \"declarativeContent.UnknownType\",\n"
"}"),
@@ -105,6 +105,7 @@ TEST(DeclarativeContentActionTest, ShowPageActionWithoutPageAction) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
NULL,
+ HostID(HostID::EXTENSIONS, extension->id()),
extension,
*ParseJson(
"{\n"
@@ -126,6 +127,7 @@ TEST(DeclarativeContentActionTest, ShowPageAction) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
NULL,
+ HostID(HostID::EXTENSIONS, extension->id()),
extension,
*ParseJson(
"{\n"
@@ -184,6 +186,7 @@ TEST(DeclarativeContentActionTest, SetIcon) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
NULL,
+ HostID(HostID::EXTENSIONS, extension->id()),
extension,
*dict,
&error,
@@ -216,6 +219,7 @@ TEST_F(RequestContentScriptTest, MissingScripts) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"
@@ -236,6 +240,7 @@ TEST_F(RequestContentScriptTest, CSS) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"
@@ -256,6 +261,7 @@ TEST_F(RequestContentScriptTest, JS) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"
@@ -276,6 +282,7 @@ TEST_F(RequestContentScriptTest, CSSBadType) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"
@@ -294,6 +301,7 @@ TEST_F(RequestContentScriptTest, JSBadType) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"
@@ -312,6 +320,7 @@ TEST_F(RequestContentScriptTest, AllFrames) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"
@@ -333,6 +342,7 @@ TEST_F(RequestContentScriptTest, MatchAboutBlank) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"
@@ -354,6 +364,7 @@ TEST_F(RequestContentScriptTest, AllFramesBadType) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"
@@ -373,6 +384,7 @@ TEST_F(RequestContentScriptTest, MatchAboutBlankBadType) {
bool bad_message = false;
scoped_refptr<const ContentAction> result = ContentAction::Create(
profile(),
+ HostID(HostID::EXTENSIONS, extension()->id()),
extension(),
*ParseJson(
"{\n"

Powered by Google App Engine
This is Rietveld 408576698