| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro
ller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 info.identity_status = WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN; | 253 info.identity_status = WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN; |
| 254 | 254 |
| 255 CreateBubble(); | 255 CreateBubble(); |
| 256 | 256 |
| 257 // Set identity info, specifying that the button should not be shown. | 257 // Set identity info, specifying that the button should not be shown. |
| 258 info.show_ssl_decision_revoke_button = false; | 258 info.show_ssl_decision_revoke_button = false; |
| 259 bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info)); | 259 bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info)); |
| 260 EXPECT_EQ([controller_ resetDecisionsButton], nil); | 260 EXPECT_EQ([controller_ resetDecisionsButton], nil); |
| 261 | 261 |
| 262 // Set identity info, specifying that the button should be shown. | 262 // Set identity info, specifying that the button should be shown. |
| 263 info.cert_id = 1; |
| 263 info.show_ssl_decision_revoke_button = true; | 264 info.show_ssl_decision_revoke_button = true; |
| 264 bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info)); | 265 bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info)); |
| 265 EXPECT_NE([controller_ resetDecisionsButton], nil); | 266 EXPECT_NE([controller_ resetDecisionsButton], nil); |
| 266 | 267 |
| 267 // Check that clicking the button calls the right selector. | 268 // Check that clicking the button calls the right selector. |
| 268 EXPECT_EQ([[controller_ resetDecisionsButton] action], | 269 EXPECT_EQ([[controller_ resetDecisionsButton] action], |
| 269 @selector(resetCertificateDecisions:)); | 270 @selector(resetCertificateDecisions:)); |
| 270 | 271 |
| 271 // Since the bubble is only created once per identity, we only need to check | 272 // Since the bubble is only created once per identity, we only need to check |
| 272 // the button is *added* when needed. So we don't check that it's removed | 273 // the button is *added* when needed. So we don't check that it's removed |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 344 } |
| 344 if ([view isKindOfClass:[NSPopUpButton class]]) { | 345 if ([view isKindOfClass:[NSPopUpButton class]]) { |
| 345 NSPopUpButton* button = static_cast<NSPopUpButton*>(view); | 346 NSPopUpButton* button = static_cast<NSPopUpButton*>(view); |
| 346 EXPECT_LT(NSMaxX([button frame]), window_width); | 347 EXPECT_LT(NSMaxX([button frame]), window_width); |
| 347 } | 348 } |
| 348 } | 349 } |
| 349 } | 350 } |
| 350 } | 351 } |
| 351 | 352 |
| 352 } // namespace | 353 } // namespace |
| OLD | NEW |