Commit f438e6d4 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Rename some ContentSettingsObserver tests.

They should not be called ChromeRenderViewTest, which is the name of the
base test class.

Change-Id: I7e25511b86d62c9c7bc480a97216c27aa2b42558
Reviewed-on: https://chromium-review.googlesource.com/749107Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513207}
parent fbc6a26b
...@@ -104,9 +104,10 @@ class ContentSettingsObserver ...@@ -104,9 +104,10 @@ class ContentSettingsObserver
private: private:
FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes); FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes);
FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverBrowserTest,
ContentSettingsInterstitialPages); ContentSettingsInterstitialPages);
FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, PluginsTemporarilyAllowed); FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverBrowserTest,
PluginsTemporarilyAllowed);
// RenderFrameObserver implementation. // RenderFrameObserver implementation.
bool OnMessageReceived(const IPC::Message& message) override; bool OnMessageReceived(const IPC::Message& message) override;
......
...@@ -110,7 +110,9 @@ class CommitTimeConditionChecker : public content::RenderFrameObserver { ...@@ -110,7 +110,9 @@ class CommitTimeConditionChecker : public content::RenderFrameObserver {
} // namespace } // namespace
TEST_F(ChromeRenderViewTest, DidBlockContentType) { using ContentSettingsObserverBrowserTest = ChromeRenderViewTest;
TEST_F(ContentSettingsObserverBrowserTest, DidBlockContentType) {
MockContentSettingsObserver observer(view_->GetMainRenderFrame(), MockContentSettingsObserver observer(view_->GetMainRenderFrame(),
registry_.get()); registry_.get());
EXPECT_CALL(observer, OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, EXPECT_CALL(observer, OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES,
...@@ -124,7 +126,7 @@ TEST_F(ChromeRenderViewTest, DidBlockContentType) { ...@@ -124,7 +126,7 @@ TEST_F(ChromeRenderViewTest, DidBlockContentType) {
// Tests that multiple invokations of AllowDOMStorage result in a single IPC. // Tests that multiple invokations of AllowDOMStorage result in a single IPC.
// Fails due to http://crbug.com/104300 // Fails due to http://crbug.com/104300
TEST_F(ChromeRenderViewTest, DISABLED_AllowDOMStorage) { TEST_F(ContentSettingsObserverBrowserTest, DISABLED_AllowDOMStorage) {
// Load some HTML, so we have a valid security origin. // Load some HTML, so we have a valid security origin.
LoadHTML("<html></html>"); LoadHTML("<html></html>");
MockContentSettingsObserver observer(view_->GetMainRenderFrame(), MockContentSettingsObserver observer(view_->GetMainRenderFrame(),
...@@ -142,7 +144,7 @@ TEST_F(ChromeRenderViewTest, DISABLED_AllowDOMStorage) { ...@@ -142,7 +144,7 @@ TEST_F(ChromeRenderViewTest, DISABLED_AllowDOMStorage) {
} }
// Regression test for http://crbug.com/35011 // Regression test for http://crbug.com/35011
TEST_F(ChromeRenderViewTest, JSBlockSentAfterPageLoad) { TEST_F(ContentSettingsObserverBrowserTest, JSBlockSentAfterPageLoad) {
// 1. Load page with JS. // 1. Load page with JS.
const char kHtml[] = const char kHtml[] =
"<html>" "<html>"
...@@ -194,7 +196,7 @@ TEST_F(ChromeRenderViewTest, JSBlockSentAfterPageLoad) { ...@@ -194,7 +196,7 @@ TEST_F(ChromeRenderViewTest, JSBlockSentAfterPageLoad) {
EXPECT_TRUE(HasSentChromeViewHostMsgContentBlocked(render_thread_.get())); EXPECT_TRUE(HasSentChromeViewHostMsgContentBlocked(render_thread_.get()));
} }
TEST_F(ChromeRenderViewTest, PluginsTemporarilyAllowed) { TEST_F(ContentSettingsObserverBrowserTest, PluginsTemporarilyAllowed) {
// Load some HTML. // Load some HTML.
LoadHTML("<html>Foo</html>"); LoadHTML("<html>Foo</html>");
...@@ -226,7 +228,7 @@ TEST_F(ChromeRenderViewTest, PluginsTemporarilyAllowed) { ...@@ -226,7 +228,7 @@ TEST_F(ChromeRenderViewTest, PluginsTemporarilyAllowed) {
EXPECT_TRUE(observer->IsPluginTemporarilyAllowed(bar_plugin)); EXPECT_TRUE(observer->IsPluginTemporarilyAllowed(bar_plugin));
} }
TEST_F(ChromeRenderViewTest, ImagesBlockedByDefault) { TEST_F(ContentSettingsObserverBrowserTest, ImagesBlockedByDefault) {
MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(), MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(),
registry_.get()); registry_.get());
...@@ -265,7 +267,7 @@ TEST_F(ChromeRenderViewTest, ImagesBlockedByDefault) { ...@@ -265,7 +267,7 @@ TEST_F(ChromeRenderViewTest, ImagesBlockedByDefault) {
::testing::Mock::VerifyAndClearExpectations(&observer); ::testing::Mock::VerifyAndClearExpectations(&observer);
} }
TEST_F(ChromeRenderViewTest, ImagesAllowedByDefault) { TEST_F(ContentSettingsObserverBrowserTest, ImagesAllowedByDefault) {
MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(), MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(),
registry_.get()); registry_.get());
...@@ -303,7 +305,7 @@ TEST_F(ChromeRenderViewTest, ImagesAllowedByDefault) { ...@@ -303,7 +305,7 @@ TEST_F(ChromeRenderViewTest, ImagesAllowedByDefault) {
::testing::Mock::VerifyAndClearExpectations(&observer); ::testing::Mock::VerifyAndClearExpectations(&observer);
} }
TEST_F(ChromeRenderViewTest, ContentSettingsBlockScripts) { TEST_F(ContentSettingsObserverBrowserTest, ContentSettingsBlockScripts) {
// Set the content settings for scripts. // Set the content settings for scripts.
RendererContentSettingRules content_setting_rules; RendererContentSettingRules content_setting_rules;
ContentSettingsForOneType& script_setting_rules = ContentSettingsForOneType& script_setting_rules =
...@@ -325,7 +327,7 @@ TEST_F(ChromeRenderViewTest, ContentSettingsBlockScripts) { ...@@ -325,7 +327,7 @@ TEST_F(ChromeRenderViewTest, ContentSettingsBlockScripts) {
ChromeViewHostMsg_ContentBlocked::ID)); ChromeViewHostMsg_ContentBlocked::ID));
} }
TEST_F(ChromeRenderViewTest, ContentSettingsAllowScripts) { TEST_F(ContentSettingsObserverBrowserTest, ContentSettingsAllowScripts) {
// Set the content settings for scripts. // Set the content settings for scripts.
RendererContentSettingRules content_setting_rules; RendererContentSettingRules content_setting_rules;
ContentSettingsForOneType& script_setting_rules = ContentSettingsForOneType& script_setting_rules =
...@@ -350,7 +352,7 @@ TEST_F(ChromeRenderViewTest, ContentSettingsAllowScripts) { ...@@ -350,7 +352,7 @@ TEST_F(ChromeRenderViewTest, ContentSettingsAllowScripts) {
// Regression test for crbug.com/232410: Load a page with JS blocked. Then, // Regression test for crbug.com/232410: Load a page with JS blocked. Then,
// allow JS and reload the page. In each case, only one of noscript or script // allow JS and reload the page. In each case, only one of noscript or script
// tags should be enabled, but never both. // tags should be enabled, but never both.
TEST_F(ChromeRenderViewTest, ContentSettingsNoscriptTag) { TEST_F(ContentSettingsObserverBrowserTest, ContentSettingsNoscriptTag) {
// 1. Block JavaScript. // 1. Block JavaScript.
RendererContentSettingRules content_setting_rules; RendererContentSettingRules content_setting_rules;
ContentSettingsForOneType& script_setting_rules = ContentSettingsForOneType& script_setting_rules =
...@@ -414,7 +416,8 @@ TEST_F(ChromeRenderViewTest, ContentSettingsNoscriptTag) { ...@@ -414,7 +416,8 @@ TEST_F(ChromeRenderViewTest, ContentSettingsNoscriptTag) {
// Checks that same document navigations don't update content settings for the // Checks that same document navigations don't update content settings for the
// page. // page.
TEST_F(ChromeRenderViewTest, ContentSettingsSameDocumentNavigation) { TEST_F(ContentSettingsObserverBrowserTest,
ContentSettingsSameDocumentNavigation) {
MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(), MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(),
registry_.get()); registry_.get());
// Load a page which contains a script. // Load a page which contains a script.
...@@ -443,7 +446,7 @@ TEST_F(ChromeRenderViewTest, ContentSettingsSameDocumentNavigation) { ...@@ -443,7 +446,7 @@ TEST_F(ChromeRenderViewTest, ContentSettingsSameDocumentNavigation) {
EXPECT_TRUE(observer->AllowScript(true)); EXPECT_TRUE(observer->AllowScript(true));
} }
TEST_F(ChromeRenderViewTest, ContentSettingsInterstitialPages) { TEST_F(ContentSettingsObserverBrowserTest, ContentSettingsInterstitialPages) {
MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(), MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(),
registry_.get()); registry_.get());
// Block scripts. // Block scripts.
...@@ -481,7 +484,7 @@ TEST_F(ChromeRenderViewTest, ContentSettingsInterstitialPages) { ...@@ -481,7 +484,7 @@ TEST_F(ChromeRenderViewTest, ContentSettingsInterstitialPages) {
::testing::Mock::VerifyAndClearExpectations(&observer); ::testing::Mock::VerifyAndClearExpectations(&observer);
} }
TEST_F(ChromeRenderViewTest, AutoplayContentSettings) { TEST_F(ContentSettingsObserverBrowserTest, AutoplayContentSettings) {
MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(), MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame(),
registry_.get()); registry_.get());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment