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

Unified Diff: chrome/browser/cocoa/extensions/browser_actions_container_view_unittest.mm

Issue 2426002: [Mac] Updates the unit test with some minor tweaks to the Browser Actions con... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 7 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/extensions/browser_actions_container_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/extensions/browser_actions_container_view_unittest.mm
===================================================================
--- chrome/browser/cocoa/extensions/browser_actions_container_view_unittest.mm (revision 48636)
+++ chrome/browser/cocoa/extensions/browser_actions_container_view_unittest.mm (working copy)
@@ -11,6 +11,7 @@
namespace {
const CGFloat kContainerHeight = 15.0;
+const CGFloat kMinimumContainerWidth = 10.0;
class BrowserActionsContainerViewTest : public CocoaTest {
public:
@@ -30,4 +31,22 @@
EXPECT_TRUE([view_ isHidden]);
}
+TEST_F(BrowserActionsContainerViewTest, SetWidthTests) {
+ // Try setting below the minimum width (10 pixels).
+ [view_ resizeToWidth:5.0 animate:NO];
+ EXPECT_EQ(kMinimumContainerWidth, NSWidth([view_ frame])) << "Frame width is "
+ << "less than the minimum allowed.";
+ // Since the frame expands to the left, the x-position delta value will be
+ // negative.
+ EXPECT_EQ(-kMinimumContainerWidth, [view_ resizeDeltaX]);
+
+ [view_ resizeToWidth:35.0 animate:NO];
+ EXPECT_EQ(35.0, NSWidth([view_ frame]));
+ EXPECT_EQ(-25.0, [view_ resizeDeltaX]);
+
+ [view_ resizeToWidth:20.0 animate:NO];
+ EXPECT_EQ(20.0, NSWidth([view_ frame]));
+ EXPECT_EQ(15.0, [view_ resizeDeltaX]);
+}
+
} // namespace
« no previous file with comments | « chrome/browser/cocoa/extensions/browser_actions_container_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698