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

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

Issue 1009613002: [Toolbar UI Mac] Fix omnibox minimum width (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: chrome/browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm
diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm
index 6db7722a2273c37544241fc275eba72a09f9f4b6..3d7788a2b6a6465e281aebd6692ed5a19e755caf 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm
@@ -12,6 +12,18 @@ namespace {
const CGFloat kContainerHeight = 15.0;
const CGFloat kMinimumContainerWidth = 3.0;
+const CGFloat kMaxAllowedWidthForTest = 50.0;
+
+class BrowserActionsContainerTestDelegate
+ : public BrowserActionsContainerViewSizeDelegate {
+ public:
+ BrowserActionsContainerTestDelegate() {}
+ ~BrowserActionsContainerTestDelegate() override {}
+ CGFloat GetMaxAllowedWidth() override { return kMaxAllowedWidthForTest; }
Avi (use Gerrit) 2015/03/13 23:26:03 blank line before
Devlin 2015/03/14 00:03:14 Done.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainerTestDelegate);
+};
class BrowserActionsContainerViewTest : public CocoaTest {
public:
@@ -64,6 +76,12 @@ TEST_F(BrowserActionsContainerViewTest, SetWidthTests) {
[view_ resizeToWidth:35.0 animate:NO];
EXPECT_EQ(35.0, NSWidth([view_ frame]));
EXPECT_EQ(35.0, NSWidth([view_ animationEndFrame]));
+
+ BrowserActionsContainerTestDelegate delegate;
+ [view_ setDelegate:&delegate];
+ [view_ resizeToWidth:kMaxAllowedWidthForTest + 10.0 animate:NO];
+ EXPECT_EQ(kMaxAllowedWidthForTest, NSWidth([view_ frame]));
+ [view_ setDelegate:nil];
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698