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

Unified Diff: chrome/browser/cocoa/infobar_controller_unittest.mm

Issue 1127001: Implement the confirm infobar with link for mac.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/infobar_controller.mm ('k') | chrome/browser/cocoa/infobar_test_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/infobar_controller_unittest.mm
===================================================================
--- chrome/browser/cocoa/infobar_controller_unittest.mm (revision 41951)
+++ chrome/browser/cocoa/infobar_controller_unittest.mm (working copy)
@@ -180,8 +180,9 @@
TEST_VIEW(ConfirmInfoBarControllerTest, [controller_ view]);
TEST_F(ConfirmInfoBarControllerTest, ShowAndDismiss) {
- // Make sure someone looked at the message and icon.
+ // Make sure someone looked at the message, link, and icon.
EXPECT_TRUE(delegate_.message_text_accessed);
+ EXPECT_TRUE(delegate_.link_text_accessed);
EXPECT_TRUE(delegate_.icon_accessed);
// Check to make sure the infobar message was set properly.
@@ -192,6 +193,7 @@
[controller_ dismiss:nil];
EXPECT_FALSE(delegate_.ok_clicked);
EXPECT_FALSE(delegate_.cancel_clicked);
+ EXPECT_FALSE(delegate_.link_clicked);
EXPECT_TRUE(delegate_.closed);
}
@@ -201,6 +203,7 @@
[controller_ ok:nil];
EXPECT_TRUE(delegate_.ok_clicked);
EXPECT_FALSE(delegate_.cancel_clicked);
+ EXPECT_FALSE(delegate_.link_clicked);
EXPECT_TRUE(delegate_.closed);
}
@@ -212,6 +215,7 @@
[controller_ ok:nil];
EXPECT_TRUE(delegate_.ok_clicked);
EXPECT_FALSE(delegate_.cancel_clicked);
+ EXPECT_FALSE(delegate_.link_clicked);
EXPECT_FALSE(delegate_.closed);
}
@@ -221,6 +225,7 @@
[controller_ cancel:nil];
EXPECT_FALSE(delegate_.ok_clicked);
EXPECT_TRUE(delegate_.cancel_clicked);
+ EXPECT_FALSE(delegate_.link_clicked);
EXPECT_TRUE(delegate_.closed);
}
@@ -232,7 +237,30 @@
[controller_ cancel:nil];
EXPECT_FALSE(delegate_.ok_clicked);
EXPECT_TRUE(delegate_.cancel_clicked);
+ EXPECT_FALSE(delegate_.link_clicked);
EXPECT_FALSE(delegate_.closed);
}
+TEST_F(ConfirmInfoBarControllerTest, ShowAndClickLink) {
+ // Check that clicking on the link calls LinkClicked() on the
+ // delegate. It should also close the infobar.
+ [controller_ linkClicked];
+ EXPECT_FALSE(delegate_.ok_clicked);
+ EXPECT_FALSE(delegate_.cancel_clicked);
+ EXPECT_TRUE(delegate_.link_clicked);
+ EXPECT_TRUE(delegate_.closed);
+}
+
+TEST_F(ConfirmInfoBarControllerTest, ShowAndClickLinkWithoutClosing) {
+ delegate_.closes_on_action = false;
+
+ // Check that clicking on the link calls LinkClicked() on the
+ // delegate. It should not close the infobar.
+ [controller_ linkClicked];
+ EXPECT_FALSE(delegate_.ok_clicked);
+ EXPECT_FALSE(delegate_.cancel_clicked);
+ EXPECT_TRUE(delegate_.link_clicked);
+ EXPECT_FALSE(delegate_.closed);
+}
+
} // namespace
« no previous file with comments | « chrome/browser/cocoa/infobar_controller.mm ('k') | chrome/browser/cocoa/infobar_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698