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

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings_unittest.cc

Issue 2377603002: Disable ServiceWorker when JS is disabled (Closed)
Patch Set: Updated comments, removed the mock headers and renamed the function Created 4 years, 2 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/content_settings/tab_specific_content_settings_unittest.cc
diff --git a/chrome/browser/content_settings/tab_specific_content_settings_unittest.cc b/chrome/browser/content_settings/tab_specific_content_settings_unittest.cc
index ebb6a5e4e3ccefb27999f70f91217ae8ca75ebbe..50b1488c28735650caab62f74ffd9ce008bffece 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings_unittest.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings_unittest.cc
@@ -126,15 +126,22 @@ TEST_F(TabSpecificContentSettingsTest, BlockedContent) {
EXPECT_TRUE(
content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
+ // Block a javascript during a navigation.
+ content_settings->OnServiceWorkerAccessed(GURL("http://google.com"),
+ true, false);
+ EXPECT_TRUE(
+ content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_JAVASCRIPT));
+
// Reset blocked content settings.
- content_settings->ClearBlockedContentSettingsExceptForCookies();
+ content_settings
+ ->ClearContentSettingsExceptForNavigationRelatedSettings();
#if !defined(OS_ANDROID)
EXPECT_FALSE(
content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES));
EXPECT_FALSE(
content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS));
#endif
- EXPECT_FALSE(
+ EXPECT_TRUE(
content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_JAVASCRIPT));
EXPECT_TRUE(
content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
@@ -147,7 +154,7 @@ TEST_F(TabSpecificContentSettingsTest, BlockedContent) {
EXPECT_FALSE(
content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_KEYGEN));
- content_settings->ClearCookieSpecificContentSettings();
+ content_settings->ClearNavigationRelatedContentSettings();
#if !defined(OS_ANDROID)
EXPECT_FALSE(
content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES));

Powered by Google App Engine
This is Rietveld 408576698