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

Unified Diff: chrome/renderer/content_settings_observer_browsertest.cc

Issue 106713004: Remove kEnableResourceContentSettings and all the code that uses it since it's been behind a flag f… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 7 years 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
« no previous file with comments | « chrome/renderer/content_settings_observer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/content_settings_observer_browsertest.cc
===================================================================
--- chrome/renderer/content_settings_observer_browsertest.cc (revision 239860)
+++ chrome/renderer/content_settings_observer_browsertest.cc (working copy)
@@ -23,8 +23,8 @@
virtual bool Send(IPC::Message* message);
- MOCK_METHOD2(OnContentBlocked,
- void(ContentSettingsType, const std::string&));
+ MOCK_METHOD1(OnContentBlocked,
+ void(ContentSettingsType));
MOCK_METHOD5(OnAllowDOMStorage,
void(int, const GURL&, const GURL&, bool, IPC::Message*));
@@ -56,22 +56,12 @@
TEST_F(ChromeRenderViewTest, DidBlockContentType) {
MockContentSettingsObserver observer(view_);
EXPECT_CALL(observer,
- OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
- observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
+ observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_COOKIES);
// Blocking the same content type a second time shouldn't send a notification.
- observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
+ observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_COOKIES);
::testing::Mock::VerifyAndClearExpectations(&observer);
-
- // Blocking two different plugins should send two notifications.
- std::string kFooPlugin = "foo";
- std::string kBarPlugin = "bar";
- EXPECT_CALL(observer,
- OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS, kFooPlugin));
- EXPECT_CALL(observer,
- OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS, kBarPlugin));
- observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, kFooPlugin);
- observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, kBarPlugin);
}
// Tests that multiple invokations of AllowDOMStorage result in a single IPC.
@@ -198,7 +188,7 @@
ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_);
observer->SetContentSettingRules(&content_setting_rules);
EXPECT_CALL(mock_observer,
- OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES));
EXPECT_FALSE(observer->AllowImage(GetMainFrame(),
true, mock_observer.image_url_));
::testing::Mock::VerifyAndClearExpectations(&observer);
@@ -215,7 +205,7 @@
EXPECT_CALL(
mock_observer,
- OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string())).Times(0);
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES)).Times(0);
EXPECT_TRUE(observer->AllowImage(GetMainFrame(), true,
mock_observer.image_url_));
::testing::Mock::VerifyAndClearExpectations(&observer);
@@ -242,7 +232,7 @@
observer->SetContentSettingRules(&content_setting_rules);
EXPECT_CALL(
mock_observer,
- OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string())).Times(0);
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES)).Times(0);
EXPECT_TRUE(observer->AllowImage(GetMainFrame(), true,
mock_observer.image_url_));
::testing::Mock::VerifyAndClearExpectations(&observer);
@@ -257,7 +247,7 @@
std::string(),
false));
EXPECT_CALL(mock_observer,
- OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES));
EXPECT_FALSE(observer->AllowImage(GetMainFrame(),
true, mock_observer.image_url_));
::testing::Mock::VerifyAndClearExpectations(&observer);
@@ -381,7 +371,7 @@
// Verify that images are allowed.
EXPECT_CALL(
mock_observer,
- OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string())).Times(0);
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES)).Times(0);
EXPECT_TRUE(observer->AllowImage(GetMainFrame(), true,
mock_observer.image_url_));
::testing::Mock::VerifyAndClearExpectations(&observer);
« no previous file with comments | « chrome/renderer/content_settings_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698