Index: chrome/browser/ui/cocoa/page_info/page_info_bubble_controller_unittest.mm |
diff --git a/chrome/browser/ui/cocoa/page_info/website_settings_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/page_info/page_info_bubble_controller_unittest.mm |
similarity index 89% |
rename from chrome/browser/ui/cocoa/page_info/website_settings_bubble_controller_unittest.mm |
rename to chrome/browser/ui/cocoa/page_info/page_info_bubble_controller_unittest.mm |
index 45795a110a99a77898c67927908b6a59b061722b..36ac1494068cfe48a7d8ea3e22edb0e675348274 100644 |
--- a/chrome/browser/ui/cocoa/page_info/website_settings_bubble_controller_unittest.mm |
+++ b/chrome/browser/ui/cocoa/page_info/page_info_bubble_controller_unittest.mm |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#import "chrome/browser/ui/cocoa/page_info/website_settings_bubble_controller.h" |
+#import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h" |
#include <stddef.h> |
@@ -16,13 +16,13 @@ |
#include "net/test/test_certificate_data.h" |
#include "testing/gtest_mac.h" |
-@interface WebsiteSettingsBubbleController (ExposedForTesting) |
+@interface PageInfoBubbleController (ExposedForTesting) |
- (NSView*)permissionsView; |
- (NSButton*)resetDecisionsButton; |
- (NSButton*)connectionHelpButton; |
@end |
-@implementation WebsiteSettingsBubbleController (ExposedForTesting) |
+@implementation PageInfoBubbleController (ExposedForTesting) |
- (NSView*)permissionsView { |
return permissionsView_; |
} |
@@ -35,7 +35,7 @@ |
@end |
@interface WebsiteSettingsBubbleControllerForTesting |
estark
2017/03/20 20:19:17
PageInfoBubbleControllerForTesting?
lgarron
2017/03/20 23:09:03
Seems my search didn't include Objective-C++ files
|
- : WebsiteSettingsBubbleController { |
+ : PageInfoBubbleController { |
@private |
CGFloat defaultWindowWidth_; |
} |
@@ -93,23 +93,23 @@ class WebsiteSettingsBubbleControllerTest : public CocoaTest { |
} |
protected: |
- WebsiteSettingsUIBridge* bridge_; // Weak, owned by controller. |
+ PageInfoUIBridge* bridge_; // Weak, owned by controller. |
enum MatchType { TEXT_EQUAL = 0, TEXT_NOT_EQUAL }; |
// Creates a new website settings bubble, with the given default width. |
// If |default_width| is 0, the *default* default width will be used. |
void CreateBubbleWithWidth(CGFloat default_width) { |
- bridge_ = new WebsiteSettingsUIBridge(nullptr); |
+ bridge_ = new PageInfoUIBridge(nullptr); |
// The controller cleans up after itself when the window closes. |
controller_ = [WebsiteSettingsBubbleControllerForTesting alloc]; |
[controller_ setDefaultWindowWidth:default_width]; |
- [controller_ initWithParentWindow:test_window() |
- websiteSettingsUIBridge:bridge_ |
- webContents:web_contents_factory_.CreateWebContents( |
- &profile_) |
- url:GURL("https://www.google.com")]; |
+ [controller_ |
+ initWithParentWindow:test_window() |
+ PageInfoUIBridge:bridge_ |
+ webContents:web_contents_factory_.CreateWebContents(&profile_) |
+ url:GURL("https://www.google.com")]; |
window_ = [controller_ window]; |
[controller_ showWindow:nil]; |
} |
@@ -162,7 +162,7 @@ class WebsiteSettingsBubbleControllerTest : public CocoaTest { |
// - [allow, block, ask] by default |
// - [block, allow] * [by user, by policy, by extension] |
PermissionInfoList permission_info_list; |
- WebsiteSettingsUI::PermissionInfo info; |
+ PageInfoUI::PermissionInfo info; |
for (size_t i = 0; i < arraysize(kTestPermissionTypes); ++i) { |
info.type = kTestPermissionTypes[i]; |
info.setting = kTestSettings[i]; |
@@ -186,35 +186,35 @@ class WebsiteSettingsBubbleControllerTest : public CocoaTest { |
}; |
TEST_F(WebsiteSettingsBubbleControllerTest, ConnectionHelpButton) { |
- WebsiteSettingsUI::IdentityInfo info; |
+ PageInfoUI::IdentityInfo info; |
info.site_identity = std::string("example.com"); |
- info.identity_status = WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN; |
+ info.identity_status = PageInfo::SITE_IDENTITY_STATUS_UNKNOWN; |
CreateBubble(); |
- bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info)); |
+ bridge_->SetIdentityInfo(const_cast<PageInfoUI::IdentityInfo&>(info)); |
EXPECT_EQ([[controller_ connectionHelpButton] action], |
@selector(openConnectionHelp:)); |
} |
TEST_F(WebsiteSettingsBubbleControllerTest, ResetDecisionsButton) { |
- WebsiteSettingsUI::IdentityInfo info; |
+ PageInfoUI::IdentityInfo info; |
info.site_identity = std::string("example.com"); |
- info.identity_status = WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN; |
+ info.identity_status = PageInfo::SITE_IDENTITY_STATUS_UNKNOWN; |
CreateBubble(); |
// Set identity info, specifying that the button should not be shown. |
info.show_ssl_decision_revoke_button = false; |
- bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info)); |
+ bridge_->SetIdentityInfo(const_cast<PageInfoUI::IdentityInfo&>(info)); |
EXPECT_EQ([controller_ resetDecisionsButton], nil); |
// Set identity info, specifying that the button should be shown. |
info.certificate = net::X509Certificate::CreateFromBytes( |
reinterpret_cast<const char*>(google_der), sizeof(google_der)); |
info.show_ssl_decision_revoke_button = true; |
- bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info)); |
+ bridge_->SetIdentityInfo(const_cast<PageInfoUI::IdentityInfo&>(info)); |
EXPECT_NE([controller_ resetDecisionsButton], nil); |
// Check that clicking the button calls the right selector. |