| Index: chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm
|
| diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm
|
| index 16b54a1d58f8c86002e1c0c97e7b26efe49f2e94..3355661dc3a80509efb91ac5fe02b53ef95a7602 100644
|
| --- a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm
|
| +++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm
|
| @@ -7,18 +7,19 @@
|
| #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
|
| #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h"
|
| #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_view.h"
|
| +#import "chrome/browser/ui/cocoa/static_text_view.h"
|
| #include "chrome/test/base/testing_profile.h"
|
| #include "content/browser/renderer_host/test_render_view_host.h"
|
| #include "content/browser/tab_contents/test_tab_contents.h"
|
|
|
| @interface SadTabView (ExposedForTesting)
|
| // Implementation is below.
|
| -- (NSButton*)linkButton;
|
| +- (StaticTextView*)helpTextView;
|
| @end
|
|
|
| @implementation SadTabView (ExposedForTesting)
|
| -- (NSButton*)linkButton {
|
| - return linkButton_;
|
| +- (StaticTextView*)helpTextView {
|
| + return help_.get();
|
| }
|
| @end
|
|
|
| @@ -62,9 +63,9 @@ class SadTabControllerTest : public RenderViewHostTestHarness {
|
| return controller;
|
| }
|
|
|
| - NSButton* GetLinkButton(SadTabController* controller) {
|
| + StaticTextView* GetHelpTextView(SadTabController* controller) {
|
| SadTabView* view = static_cast<SadTabView*>([controller view]);
|
| - return ([view linkButton]);
|
| + return ([view helpTextView]);
|
| }
|
|
|
| static bool link_clicked_;
|
| @@ -77,24 +78,24 @@ bool SadTabControllerTest::link_clicked_;
|
| TEST_F(SadTabControllerTest, WithTabContents) {
|
| scoped_nsobject<SadTabController> controller(CreateController());
|
| EXPECT_TRUE(controller);
|
| - NSButton* link = GetLinkButton(controller);
|
| - EXPECT_TRUE(link);
|
| + StaticTextView* help = GetHelpTextView(controller);
|
| + EXPECT_TRUE(help);
|
| }
|
|
|
| TEST_F(SadTabControllerTest, WithoutTabContents) {
|
| DeleteContents();
|
| scoped_nsobject<SadTabController> controller(CreateController());
|
| EXPECT_TRUE(controller);
|
| - NSButton* link = GetLinkButton(controller);
|
| - EXPECT_FALSE(link);
|
| + StaticTextView* help = GetHelpTextView(controller);
|
| + EXPECT_FALSE(help);
|
| }
|
|
|
| TEST_F(SadTabControllerTest, ClickOnLink) {
|
| scoped_nsobject<SadTabController> controller(CreateController());
|
| - NSButton* link = GetLinkButton(controller);
|
| - EXPECT_TRUE(link);
|
| + StaticTextView* help = GetHelpTextView(controller);
|
| + EXPECT_TRUE(help);
|
| EXPECT_FALSE(link_clicked_);
|
| - [link performClick:link];
|
| + [help clickedOnLink:nil atIndex:0];
|
| EXPECT_TRUE(link_clicked_);
|
| }
|
|
|
|
|