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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 NULL, web_contents(), profile(), CONTENT_SETTINGS_TYPE_COOKIES)); 97 NULL, web_contents(), profile(), CONTENT_SETTINGS_TYPE_COOKIES));
98 const ContentSettingBubbleModel::BubbleContent& bubble_content = 98 const ContentSettingBubbleModel::BubbleContent& bubble_content =
99 content_setting_bubble_model->bubble_content(); 99 content_setting_bubble_model->bubble_content();
100 base::string16 title = bubble_content.title; 100 base::string16 title = bubble_content.title;
101 EXPECT_FALSE(title.empty()); 101 EXPECT_FALSE(title.empty());
102 ASSERT_EQ(2U, bubble_content.radio_group.radio_items.size()); 102 ASSERT_EQ(2U, bubble_content.radio_group.radio_items.size());
103 EXPECT_FALSE(bubble_content.custom_link.empty()); 103 EXPECT_FALSE(bubble_content.custom_link.empty());
104 EXPECT_TRUE(bubble_content.custom_link_enabled); 104 EXPECT_TRUE(bubble_content.custom_link_enabled);
105 EXPECT_FALSE(bubble_content.manage_text.empty()); 105 EXPECT_FALSE(bubble_content.manage_text.empty());
106 106
107 content_settings->ClearCookieSpecificContentSettings(); 107 content_settings->ClearNavigationRelatedContentSettings();
108 content_settings->OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES); 108 content_settings->OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES);
109 content_setting_bubble_model.reset( 109 content_setting_bubble_model.reset(
110 ContentSettingBubbleModel::CreateContentSettingBubbleModel( 110 ContentSettingBubbleModel::CreateContentSettingBubbleModel(
111 NULL, web_contents(), profile(), CONTENT_SETTINGS_TYPE_COOKIES)); 111 NULL, web_contents(), profile(), CONTENT_SETTINGS_TYPE_COOKIES));
112 const ContentSettingBubbleModel::BubbleContent& bubble_content_2 = 112 const ContentSettingBubbleModel::BubbleContent& bubble_content_2 =
113 content_setting_bubble_model->bubble_content(); 113 content_setting_bubble_model->bubble_content();
114 114
115 EXPECT_FALSE(bubble_content_2.title.empty()); 115 EXPECT_FALSE(bubble_content_2.title.empty());
116 EXPECT_NE(title, bubble_content_2.title); 116 EXPECT_NE(title, bubble_content_2.title);
117 ASSERT_EQ(2U, bubble_content_2.radio_group.radio_items.size()); 117 ASSERT_EQ(2U, bubble_content_2.radio_group.radio_items.size());
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 content_setting_bubble_model->bubble_content(); 737 content_setting_bubble_model->bubble_content();
738 738
739 base::string16 title = bubble_content.title; 739 base::string16 title = bubble_content.title;
740 EXPECT_FALSE(title.empty()); 740 EXPECT_FALSE(title.empty());
741 ASSERT_EQ(2U, bubble_content.radio_group.radio_items.size()); 741 ASSERT_EQ(2U, bubble_content.radio_group.radio_items.size());
742 std::string radio1 = bubble_content.radio_group.radio_items[0]; 742 std::string radio1 = bubble_content.radio_group.radio_items[0];
743 std::string radio2 = bubble_content.radio_group.radio_items[1]; 743 std::string radio2 = bubble_content.radio_group.radio_items[1];
744 EXPECT_FALSE(bubble_content.custom_link_enabled); 744 EXPECT_FALSE(bubble_content.custom_link_enabled);
745 EXPECT_FALSE(bubble_content.manage_text.empty()); 745 EXPECT_FALSE(bubble_content.manage_text.empty());
746 746
747 content_settings->ClearBlockedContentSettingsExceptForCookies(); 747 content_settings
748 ->ClearContentSettingsExceptForNavigationRelatedSettings();
748 content_settings->OnContentAllowed(CONTENT_SETTINGS_TYPE_PPAPI_BROKER); 749 content_settings->OnContentAllowed(CONTENT_SETTINGS_TYPE_PPAPI_BROKER);
749 content_setting_bubble_model.reset( 750 content_setting_bubble_model.reset(
750 ContentSettingBubbleModel::CreateContentSettingBubbleModel( 751 ContentSettingBubbleModel::CreateContentSettingBubbleModel(
751 NULL, web_contents(), profile(), 752 NULL, web_contents(), profile(),
752 CONTENT_SETTINGS_TYPE_PPAPI_BROKER)); 753 CONTENT_SETTINGS_TYPE_PPAPI_BROKER));
753 const ContentSettingBubbleModel::BubbleContent& bubble_content_2 = 754 const ContentSettingBubbleModel::BubbleContent& bubble_content_2 =
754 content_setting_bubble_model->bubble_content(); 755 content_setting_bubble_model->bubble_content();
755 756
756 EXPECT_FALSE(bubble_content_2.title.empty()); 757 EXPECT_FALSE(bubble_content_2.title.empty());
757 EXPECT_NE(title, bubble_content_2.title); 758 EXPECT_NE(title, bubble_content_2.title);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION)); 935 IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION));
935 EXPECT_EQ(0U, bubble_content.radio_group.radio_items.size()); 936 EXPECT_EQ(0U, bubble_content.radio_group.radio_items.size());
936 EXPECT_EQ(0, bubble_content.radio_group.default_item); 937 EXPECT_EQ(0, bubble_content.radio_group.default_item);
937 EXPECT_TRUE(bubble_content.custom_link.empty()); 938 EXPECT_TRUE(bubble_content.custom_link.empty());
938 EXPECT_FALSE(bubble_content.custom_link_enabled); 939 EXPECT_FALSE(bubble_content.custom_link_enabled);
939 EXPECT_EQ( 940 EXPECT_EQ(
940 bubble_content.manage_text, 941 bubble_content.manage_text,
941 l10n_util::GetStringUTF8(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD)); 942 l10n_util::GetStringUTF8(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD));
942 EXPECT_EQ(0U, bubble_content.media_menus.size()); 943 EXPECT_EQ(0U, bubble_content.media_menus.size());
943 } 944 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698