Commit b7e2ca93 authored by Findit's avatar Findit

Revert "Handle Safety Tip learn more link in page info"

This reverts commit a9df5b29.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 706076 as the
culprit for failures in the build cycles as shown on:
https://analysis.chromium.org/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtL2E5ZGY1YjI5ZmEyMzliNzQ5N2VjMmQ1NTFlNWNmNDQ3MDMzMGRiNDUM

Sample Failed Build: https://ci.chromium.org/buildbot/chromium.memory/Linux%20CFI/15311

Sample Failed Step: browser_tests

Original change's description:
> Handle Safety Tip learn more link in page info
> 
> Bug: 1007497
> Change-Id: I4498d39cabf4736a697294ad027082a53894a623
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857166
> Reviewed-by: Joe DeBlasio <jdeblasio@chromium.org>
> Reviewed-by: Emily Stark <estark@chromium.org>
> Commit-Queue: Livvie Lin <livvielin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#706076}


Change-Id: I017d2046e5fce908c8f86ea2b2726d88b590a3da
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1007497
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864001
Cr-Commit-Position: refs/heads/master@{#706247}
parent 27e89d02
...@@ -186,14 +186,12 @@ base::span<const PermissionsUIInfo> GetContentSettingsUIInfo() { ...@@ -186,14 +186,12 @@ base::span<const PermissionsUIInfo> GetContentSettingsUIInfo() {
std::unique_ptr<PageInfoUI::SecurityDescription> CreateSecurityDescription( std::unique_ptr<PageInfoUI::SecurityDescription> CreateSecurityDescription(
PageInfoUI::SecuritySummaryColor style, PageInfoUI::SecuritySummaryColor style,
int summary_id, int summary_id,
int details_id, int details_id) {
PageInfoUI::SecurityDescriptionType type) {
std::unique_ptr<PageInfoUI::SecurityDescription> security_description( std::unique_ptr<PageInfoUI::SecurityDescription> security_description(
new PageInfoUI::SecurityDescription()); new PageInfoUI::SecurityDescription());
security_description->summary_style = style; security_description->summary_style = style;
security_description->summary = l10n_util::GetStringUTF16(summary_id); security_description->summary = l10n_util::GetStringUTF16(summary_id);
security_description->details = l10n_util::GetStringUTF16(details_id); security_description->details = l10n_util::GetStringUTF16(details_id);
security_description->type = type;
return security_description; return security_description;
} }
...@@ -257,18 +255,15 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const { ...@@ -257,18 +255,15 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const {
case PageInfo::SAFE_BROWSING_STATUS_MALWARE: case PageInfo::SAFE_BROWSING_STATUS_MALWARE:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(SecuritySummaryColor::RED,
IDS_PAGE_INFO_MALWARE_SUMMARY, IDS_PAGE_INFO_MALWARE_SUMMARY,
IDS_PAGE_INFO_MALWARE_DETAILS, IDS_PAGE_INFO_MALWARE_DETAILS);
SecurityDescriptionType::SAFE_BROWSING);
case PageInfo::SAFE_BROWSING_STATUS_SOCIAL_ENGINEERING: case PageInfo::SAFE_BROWSING_STATUS_SOCIAL_ENGINEERING:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(
IDS_PAGE_INFO_SOCIAL_ENGINEERING_SUMMARY, SecuritySummaryColor::RED, IDS_PAGE_INFO_SOCIAL_ENGINEERING_SUMMARY,
IDS_PAGE_INFO_SOCIAL_ENGINEERING_DETAILS, IDS_PAGE_INFO_SOCIAL_ENGINEERING_DETAILS);
SecurityDescriptionType::SAFE_BROWSING);
case PageInfo::SAFE_BROWSING_STATUS_UNWANTED_SOFTWARE: case PageInfo::SAFE_BROWSING_STATUS_UNWANTED_SOFTWARE:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(SecuritySummaryColor::RED,
IDS_PAGE_INFO_UNWANTED_SOFTWARE_SUMMARY, IDS_PAGE_INFO_UNWANTED_SOFTWARE_SUMMARY,
IDS_PAGE_INFO_UNWANTED_SOFTWARE_DETAILS, IDS_PAGE_INFO_UNWANTED_SOFTWARE_DETAILS);
SecurityDescriptionType::SAFE_BROWSING);
case PageInfo::SAFE_BROWSING_STATUS_SAVED_PASSWORD_REUSE: case PageInfo::SAFE_BROWSING_STATUS_SAVED_PASSWORD_REUSE:
case PageInfo::SAFE_BROWSING_STATUS_SIGNED_IN_SYNC_PASSWORD_REUSE: case PageInfo::SAFE_BROWSING_STATUS_SIGNED_IN_SYNC_PASSWORD_REUSE:
case PageInfo::SAFE_BROWSING_STATUS_SIGNED_IN_NON_SYNC_PASSWORD_REUSE: case PageInfo::SAFE_BROWSING_STATUS_SIGNED_IN_NON_SYNC_PASSWORD_REUSE:
...@@ -281,8 +276,7 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const { ...@@ -281,8 +276,7 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const {
case PageInfo::SAFE_BROWSING_STATUS_BILLING: case PageInfo::SAFE_BROWSING_STATUS_BILLING:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(SecuritySummaryColor::RED,
IDS_PAGE_INFO_BILLING_SUMMARY, IDS_PAGE_INFO_BILLING_SUMMARY,
IDS_PAGE_INFO_BILLING_DETAILS, IDS_PAGE_INFO_BILLING_DETAILS);
SecurityDescriptionType::SAFE_BROWSING);
} }
switch (identity_info.safety_tip_status) { switch (identity_info.safety_tip_status) {
...@@ -290,8 +284,7 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const { ...@@ -290,8 +284,7 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const {
return CreateSecurityDescription( return CreateSecurityDescription(
SecuritySummaryColor::RED, SecuritySummaryColor::RED,
IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_TITLE, IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_TITLE,
IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_DESCRIPTION, IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_DESCRIPTION);
SecurityDescriptionType::SAFETY_TIP);
case security_state::SafetyTipStatus::kLookalike: case security_state::SafetyTipStatus::kLookalike:
// Lookalikes have their own strings, but they're suggestions, not // Lookalikes have their own strings, but they're suggestions, not
// warnings, so we leave Page Info alone. // warnings, so we leave Page Info alone.
...@@ -308,9 +301,9 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const { ...@@ -308,9 +301,9 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// We provide identical summary and detail strings for Android, which // We provide identical summary and detail strings for Android, which
// deduplicates them in the UI code. // deduplicates them in the UI code.
return CreateSecurityDescription( return CreateSecurityDescription(SecuritySummaryColor::GREEN,
SecuritySummaryColor::GREEN, IDS_PAGE_INFO_INTERNAL_PAGE, IDS_PAGE_INFO_INTERNAL_PAGE,
IDS_PAGE_INFO_INTERNAL_PAGE, SecurityDescriptionType::INTERNAL); IDS_PAGE_INFO_INTERNAL_PAGE);
#else #else
// Internal pages on desktop have their own UI implementations which // Internal pages on desktop have their own UI implementations which
// should never call this function. // should never call this function.
...@@ -326,28 +319,23 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const { ...@@ -326,28 +319,23 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const {
case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(SecuritySummaryColor::RED,
IDS_PAGE_INFO_NOT_SECURE_SUMMARY, IDS_PAGE_INFO_NOT_SECURE_SUMMARY,
IDS_PAGE_INFO_NOT_SECURE_DETAILS, IDS_PAGE_INFO_NOT_SECURE_DETAILS);
SecurityDescriptionType::CONNECTION);
case PageInfo::SITE_CONNECTION_STATUS_INSECURE_FORM_ACTION: case PageInfo::SITE_CONNECTION_STATUS_INSECURE_FORM_ACTION:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(SecuritySummaryColor::RED,
IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY, IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY,
IDS_PAGE_INFO_NOT_SECURE_DETAILS, IDS_PAGE_INFO_NOT_SECURE_DETAILS);
SecurityDescriptionType::CONNECTION);
case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(SecuritySummaryColor::RED,
IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY, IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY,
IDS_PAGE_INFO_MIXED_CONTENT_DETAILS, IDS_PAGE_INFO_MIXED_CONTENT_DETAILS);
SecurityDescriptionType::CONNECTION);
case PageInfo::SITE_CONNECTION_STATUS_LEGACY_TLS: case PageInfo::SITE_CONNECTION_STATUS_LEGACY_TLS:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(SecuritySummaryColor::RED,
IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY, IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY,
IDS_PAGE_INFO_LEGACY_TLS_DETAILS, IDS_PAGE_INFO_LEGACY_TLS_DETAILS);
SecurityDescriptionType::CONNECTION);
default: default:
return CreateSecurityDescription(SecuritySummaryColor::GREEN, return CreateSecurityDescription(SecuritySummaryColor::GREEN,
IDS_PAGE_INFO_SECURE_SUMMARY, IDS_PAGE_INFO_SECURE_SUMMARY,
IDS_PAGE_INFO_SECURE_DETAILS, IDS_PAGE_INFO_SECURE_DETAILS);
SecurityDescriptionType::CONNECTION);
} }
case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM:
case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN: case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN:
...@@ -355,8 +343,7 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const { ...@@ -355,8 +343,7 @@ PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const {
default: default:
return CreateSecurityDescription(SecuritySummaryColor::RED, return CreateSecurityDescription(SecuritySummaryColor::RED,
IDS_PAGE_INFO_NOT_SECURE_SUMMARY, IDS_PAGE_INFO_NOT_SECURE_SUMMARY,
IDS_PAGE_INFO_NOT_SECURE_DETAILS, IDS_PAGE_INFO_NOT_SECURE_DETAILS);
SecurityDescriptionType::CONNECTION);
} }
} }
......
...@@ -43,19 +43,6 @@ class PageInfoUI { ...@@ -43,19 +43,6 @@ class PageInfoUI {
GREEN, GREEN,
}; };
enum class SecurityDescriptionType {
// The UI describes whether the connection is secure, e.g. secure
// HTTPS, non-secure HTTP.
CONNECTION,
// The UI describes e.g. an internal (chrome://) page or extension page.
INTERNAL,
// The UI describes a Safe Browsing warning, e.g. site deceptive or contains
// malware.
SAFE_BROWSING,
// The UI shows a Safety Tip.
SAFETY_TIP,
};
struct SecurityDescription { struct SecurityDescription {
// The text style for |summary| used to color it. This provides an // The text style for |summary| used to color it. This provides an
// opinionated guide to the user on the overall security state of the site. // opinionated guide to the user on the overall security state of the site.
...@@ -65,9 +52,6 @@ class PageInfoUI { ...@@ -65,9 +52,6 @@ class PageInfoUI {
// A short paragraph with more details about the state, and how // A short paragraph with more details about the state, and how
// the user should treat it. // the user should treat it.
base::string16 details; base::string16 details;
// The category of the security description, used to determine which help
// center article to link to.
SecurityDescriptionType type;
}; };
// |CookieInfo| contains information about the cookies from a specific source. // |CookieInfo| contains information about the cookies from a specific source.
......
...@@ -116,7 +116,6 @@ class MockPageInfoUI : public PageInfoUI { ...@@ -116,7 +116,6 @@ class MockPageInfoUI : public PageInfoUI {
l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_SUMMARY); l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_SUMMARY);
security_description->details = security_description->details =
l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS); l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS);
security_description->type = SecurityDescriptionType::SAFE_BROWSING;
return security_description; return security_description;
} }
#endif #endif
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/certificate_viewer.h" #include "chrome/browser/certificate_viewer.h"
#include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/lookalikes/safety_tips/safety_tip_ui_helper.h"
#include "chrome/browser/platform_util.h" #include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/security_state_tab_helper.h" #include "chrome/browser/ssl/security_state_tab_helper.h"
...@@ -735,8 +734,8 @@ void PageInfoBubbleView::SetIdentityInfo(const IdentityInfo& identity_info) { ...@@ -735,8 +734,8 @@ void PageInfoBubbleView::SetIdentityInfo(const IdentityInfo& identity_info) {
std::unique_ptr<PageInfoUI::SecurityDescription> security_description = std::unique_ptr<PageInfoUI::SecurityDescription> security_description =
GetSecurityDescription(identity_info); GetSecurityDescription(identity_info);
// Set the bubble title, update the title label text, then apply color.
set_window_title(security_description->summary); set_window_title(security_description->summary);
set_security_description(*security_description);
GetBubbleFrameView()->UpdateWindowTitle(); GetBubbleFrameView()->UpdateWindowTitle();
int text_style = views::style::STYLE_PRIMARY; int text_style = views::style::STYLE_PRIMARY;
switch (security_description->summary_style) { switch (security_description->summary_style) {
...@@ -927,7 +926,6 @@ PageInfoBubbleView::CreateSecurityDescriptionForPasswordReuse() const { ...@@ -927,7 +926,6 @@ PageInfoBubbleView::CreateSecurityDescriptionForPasswordReuse() const {
GetPasswordProtectionService(profile_); GetPasswordProtectionService(profile_);
security_description->details = service->GetWarningDetailText( security_description->details = service->GetWarningDetailText(
service->reused_password_account_type_for_last_shown_warning()); service->reused_password_account_type_for_last_shown_warning());
security_description->type = SecurityDescriptionType::SAFE_BROWSING;
return security_description; return security_description;
} }
#endif #endif
...@@ -987,16 +985,12 @@ void PageInfoBubbleView::StyledLabelLinkClicked(views::StyledLabel* label, ...@@ -987,16 +985,12 @@ void PageInfoBubbleView::StyledLabelLinkClicked(views::StyledLabel* label,
int event_flags) { int event_flags) {
switch (label->GetID()) { switch (label->GetID()) {
case PageInfoBubbleView::VIEW_ID_PAGE_INFO_LABEL_SECURITY_DETAILS: case PageInfoBubbleView::VIEW_ID_PAGE_INFO_LABEL_SECURITY_DETAILS:
if (GetSecurityDetails().type == SecurityDescriptionType::SAFETY_TIP) { web_contents()->OpenURL(content::OpenURLParams(
safety_tips::OpenHelpCenter(web_contents()); GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(),
} else { WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
web_contents()->OpenURL(content::OpenURLParams( false));
GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(), presenter_->RecordPageInfoAction(
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED);
false));
presenter_->RecordPageInfoAction(
PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED);
}
break; break;
case PageInfoBubbleView:: case PageInfoBubbleView::
VIEW_ID_PAGE_INFO_LABEL_RESET_CERTIFICATE_DECISIONS: VIEW_ID_PAGE_INFO_LABEL_RESET_CERTIFICATE_DECISIONS:
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/browser/ui/page_info/page_info_dialog.h" #include "chrome/browser/ui/page_info/page_info_dialog.h"
#include "chrome/browser/ui/page_info/page_info_ui.h"
#include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "ui/base/buildflags.h" #include "ui/base/buildflags.h"
...@@ -72,11 +71,6 @@ void PageInfoBubbleViewBase::OnWidgetDestroying(views::Widget* widget) { ...@@ -72,11 +71,6 @@ void PageInfoBubbleViewBase::OnWidgetDestroying(views::Widget* widget) {
g_page_info_bubble = nullptr; g_page_info_bubble = nullptr;
} }
PageInfoUI::SecurityDescription PageInfoBubbleViewBase::GetSecurityDetails()
const {
return security_description_;
}
void PageInfoBubbleViewBase::RenderFrameDeleted( void PageInfoBubbleViewBase::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) { content::RenderFrameHost* render_frame_host) {
if (render_frame_host == web_contents()->GetMainFrame()) { if (render_frame_host == web_contents()->GetMainFrame()) {
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_BUBBLE_VIEW_BASE_H_ #ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_BUBBLE_VIEW_BASE_H_
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_BUBBLE_VIEW_BASE_H_ #define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_BUBBLE_VIEW_BASE_H_
#include "chrome/browser/ui/page_info/page_info_ui.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h"
...@@ -57,12 +56,7 @@ class PageInfoBubbleViewBase : public views::BubbleDialogDelegateView, ...@@ -57,12 +56,7 @@ class PageInfoBubbleViewBase : public views::BubbleDialogDelegateView,
bool ShouldShowCloseButton() const override; bool ShouldShowCloseButton() const override;
void OnWidgetDestroying(views::Widget* widget) override; void OnWidgetDestroying(views::Widget* widget) override;
PageInfoUI::SecurityDescription GetSecurityDetails() const;
void set_window_title(const base::string16& title) { window_title_ = title; } void set_window_title(const base::string16& title) { window_title_ = title; }
void set_security_description(
const PageInfoUI::SecurityDescription& description) {
security_description_ = description;
}
private: private:
// WebContentsObserver: // WebContentsObserver:
...@@ -72,7 +66,6 @@ class PageInfoBubbleViewBase : public views::BubbleDialogDelegateView, ...@@ -72,7 +66,6 @@ class PageInfoBubbleViewBase : public views::BubbleDialogDelegateView,
void DidChangeVisibleSecurityState() override; void DidChangeVisibleSecurityState() override;
base::string16 window_title_; base::string16 window_title_;
PageInfoUI::SecurityDescription security_description_;
DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleViewBase); DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleViewBase);
}; };
......
...@@ -88,9 +88,6 @@ class PageInfoBubbleViewTestApi { ...@@ -88,9 +88,6 @@ class PageInfoBubbleViewTestApi {
views::Widget::ClosedReason closed_reason() const { return *closed_reason_; } views::Widget::ClosedReason closed_reason() const { return *closed_reason_; }
base::string16 GetWindowTitle() { return view_->GetWindowTitle(); } base::string16 GetWindowTitle() { return view_->GetWindowTitle(); }
PageInfoUI::SecurityDescription GetSecurityDetails() {
return view_->GetSecurityDetails();
}
PermissionSelectorRow* GetPermissionSelectorAt(int index) { PermissionSelectorRow* GetPermissionSelectorAt(int index) {
return view_->selector_rows_[index].get(); return view_->selector_rows_[index].get();
...@@ -685,8 +682,6 @@ TEST_F(PageInfoBubbleViewTest, OpenPageInfoBubbleAfterNavigationStart) { ...@@ -685,8 +682,6 @@ TEST_F(PageInfoBubbleViewTest, OpenPageInfoBubbleAfterNavigationStart) {
api_->CreateView(); api_->CreateView();
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PAGE_INFO_NOT_SECURE_SUMMARY), EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PAGE_INFO_NOT_SECURE_SUMMARY),
api_->GetWindowTitle()); api_->GetWindowTitle());
EXPECT_EQ(PageInfoUI::SecurityDescriptionType::CONNECTION,
api_->GetSecurityDetails().type);
// Set up a test SSLInfo so that Page Info sees the connection as secure. // Set up a test SSLInfo so that Page Info sees the connection as secure.
uint16_t cipher_suite = 0xc02f; // TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16_t cipher_suite = 0xc02f; // TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
...@@ -705,8 +700,6 @@ TEST_F(PageInfoBubbleViewTest, OpenPageInfoBubbleAfterNavigationStart) { ...@@ -705,8 +700,6 @@ TEST_F(PageInfoBubbleViewTest, OpenPageInfoBubbleAfterNavigationStart) {
navigation->Commit(); navigation->Commit();
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURE_SUMMARY), EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURE_SUMMARY),
api_->GetWindowTitle()); api_->GetWindowTitle());
EXPECT_EQ(PageInfoUI::SecurityDescriptionType::CONNECTION,
api_->GetSecurityDetails().type);
} }
TEST_F(PageInfoBubbleViewTest, EnsureCloseCallback) { TEST_F(PageInfoBubbleViewTest, EnsureCloseCallback) {
......
...@@ -232,26 +232,22 @@ class SafetyTipPageInfoBubbleViewBrowserTest ...@@ -232,26 +232,22 @@ class SafetyTipPageInfoBubbleViewBrowserTest
} }
OpenPageInfoBubble(browser); OpenPageInfoBubble(browser);
auto* page_info = static_cast<SafetyTipPageInfoBubbleView*>( views::BubbleDialogDelegateView* page_info =
PageInfoBubbleViewBase::GetPageInfoBubbleForTesting()); PageInfoBubbleViewBase::GetPageInfoBubbleForTesting();
ASSERT_TRUE(page_info); ASSERT_TRUE(page_info);
EXPECT_EQ(page_info->GetWindowTitle(), EXPECT_EQ(page_info->GetWindowTitle(),
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_TITLE)); IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_TITLE));
EXPECT_EQ(page_info->GetSecurityDetails().type,
PageInfoUI::SecurityDescriptionType::SAFETY_TIP);
} }
void CheckPageInfoDoesNotShowSafetyTipInfo(Browser* browser) { void CheckPageInfoDoesNotShowSafetyTipInfo(Browser* browser) {
OpenPageInfoBubble(browser); OpenPageInfoBubble(browser);
auto* page_info = static_cast<SafetyTipPageInfoBubbleView*>( views::BubbleDialogDelegateView* page_info =
PageInfoBubbleViewBase::GetPageInfoBubbleForTesting()); PageInfoBubbleViewBase::GetPageInfoBubbleForTesting();
ASSERT_TRUE(page_info); ASSERT_TRUE(page_info);
EXPECT_NE(page_info->GetWindowTitle(), EXPECT_NE(page_info->GetWindowTitle(),
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_TITLE)); IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_TITLE));
EXPECT_NE(page_info->GetSecurityDetails().type,
PageInfoUI::SecurityDescriptionType::SAFETY_TIP);
} }
private: private:
......
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