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 |