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

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_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_webrequest/webrequest_action_unittest.cc
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc
index 6cf31541ee9ac807c06a61ac5f2a4fdc653368e0..e446cb96802bf17b3e7d513b344d6bf69f67481c 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc
@@ -58,7 +58,8 @@ scoped_ptr<WebRequestActionSet> CreateSetOfActions(const char* json) {
bool bad_message = false;
scoped_ptr<WebRequestActionSet> action_set(
- WebRequestActionSet::Create(NULL, NULL, actions, &error, &bad_message));
+ WebRequestActionSet::Create(NULL, HostID(), NULL,
+ actions, &error, &bad_message));
EXPECT_EQ("", error);
EXPECT_FALSE(bad_message);
CHECK(action_set);
@@ -187,28 +188,31 @@ TEST(WebRequestActionTest, CreateAction) {
error.clear();
base::ListValue empty_list;
result = WebRequestAction::Create(
- NULL, NULL, empty_list, &error, &bad_message);
+ NULL, HostID(), NULL, empty_list, &error, &bad_message);
EXPECT_TRUE(bad_message);
EXPECT_FALSE(result.get());
// Test missing instanceType element.
base::DictionaryValue input;
error.clear();
- result = WebRequestAction::Create(NULL, NULL, input, &error, &bad_message);
+ result = WebRequestAction::Create(
+ NULL, HostID(), NULL, input, &error, &bad_message);
EXPECT_TRUE(bad_message);
EXPECT_FALSE(result.get());
// Test wrong instanceType element.
input.SetString(keys::kInstanceTypeKey, kUnknownActionType);
error.clear();
- result = WebRequestAction::Create(NULL, NULL, input, &error, &bad_message);
+ result = WebRequestAction::Create(
+ NULL, HostID(), NULL, input, &error, &bad_message);
EXPECT_NE("", error);
EXPECT_FALSE(result.get());
// Test success
input.SetString(keys::kInstanceTypeKey, keys::kCancelRequestType);
error.clear();
- result = WebRequestAction::Create(NULL, NULL, input, &error, &bad_message);
+ result = WebRequestAction::Create(
+ NULL, HostID(), NULL, input, &error, &bad_message);
EXPECT_EQ("", error);
EXPECT_FALSE(bad_message);
ASSERT_TRUE(result.get());
@@ -224,7 +228,8 @@ TEST(WebRequestActionTest, CreateActionSet) {
// Test empty input.
error.clear();
- result = WebRequestActionSet::Create(NULL, NULL, input, &error, &bad_message);
+ result = WebRequestActionSet::Create(
+ NULL, HostID(), NULL, input, &error, &bad_message);
EXPECT_TRUE(error.empty()) << error;
EXPECT_FALSE(bad_message);
ASSERT_TRUE(result.get());
@@ -240,7 +245,8 @@ TEST(WebRequestActionTest, CreateActionSet) {
// Test success.
input.push_back(linked_ptr<base::Value>(correct_action.DeepCopy()));
error.clear();
- result = WebRequestActionSet::Create(NULL, NULL, input, &error, &bad_message);
+ result = WebRequestActionSet::Create(
+ NULL, HostID(), NULL, input, &error, &bad_message);
EXPECT_TRUE(error.empty()) << error;
EXPECT_FALSE(bad_message);
ASSERT_TRUE(result.get());
@@ -252,7 +258,8 @@ TEST(WebRequestActionTest, CreateActionSet) {
// Test failure.
input.push_back(linked_ptr<base::Value>(incorrect_action.DeepCopy()));
error.clear();
- result = WebRequestActionSet::Create(NULL, NULL, input, &error, &bad_message);
+ result = WebRequestActionSet::Create(
+ NULL, HostID(), NULL, input, &error, &bad_message);
EXPECT_NE("", error);
EXPECT_FALSE(result.get());
}

Powered by Google App Engine
This is Rietveld 408576698