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

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

Issue 384105: Mac: Animate the bookmark bar showing/hiding. (Closed)
Patch Set: Comments added per rohitrao's review. Created 11 years, 1 month 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/bookmark_bar_toolbar_view.mm ('k') | chrome/browser/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_bar_toolbar_view_unittest.mm
diff --git a/chrome/browser/cocoa/bookmark_bar_toolbar_view_unittest.mm b/chrome/browser/cocoa/bookmark_bar_toolbar_view_unittest.mm
index a6414f462f979af59dd983ab80b68b0660b3c12f..507376459e44996f70ef15f6cc7814dfe004455f 100644
--- a/chrome/browser/cocoa/bookmark_bar_toolbar_view_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bar_toolbar_view_unittest.mm
@@ -22,8 +22,7 @@ using ::testing::DoAll;
using ::testing::Return;
using ::testing::SetArgumentPointee;
-// When testing the floating drawing, we need to have a source of
-// theme data.
+// When testing the floating drawing, we need to have a source of theme data.
class MockThemeProvider : public ThemeProvider {
public:
// Cross platform methods
@@ -53,27 +52,27 @@ class MockThemeProvider : public ThemeProvider {
@end
// Allows us to control which way the view is rendered.
-@interface DrawFloatingFakeController :
+@interface DrawDetachedBarFakeController :
NSObject<BookmarkBarToolbarViewController> {
int current_tab_contents_height_;
ThemeProvider* theme_provider_;
- BOOL drawAsFloating_;
+ BOOL isShownAsDetachedBar_;
}
@property(assign) int currentTabContentsHeight;
@property(assign) ThemeProvider* themeProvider;
-@property(assign) BOOL drawAsFloatingBar;
+@property(assign) BOOL isShownAsDetachedBar;
@end
-@implementation DrawFloatingFakeController
+@implementation DrawDetachedBarFakeController
@synthesize currentTabContentsHeight = current_tab_contents_height_;
@synthesize themeProvider = theme_provider_;
-@synthesize drawAsFloatingBar = drawAsFloating_;
+@synthesize isShownAsDetachedBar = isShownAsDetachedBar_;
@end
class BookmarkBarToolbarViewTest : public PlatformTest {
public:
BookmarkBarToolbarViewTest() {
- controller_.reset([[DrawFloatingFakeController alloc] init]);
+ controller_.reset([[DrawDetachedBarFakeController alloc] init]);
NSRect frame = NSMakeRect(0, 0, 400, 40);
view_.reset([[BookmarkBarToolbarView alloc] initWithFrame:frame]);
[cocoa_helper_.contentView() addSubview:view_.get()];
@@ -81,7 +80,7 @@ class BookmarkBarToolbarViewTest : public PlatformTest {
}
CocoaTestHelper cocoa_helper_; // Inits Cocoa, creates window, etc...
- scoped_nsobject<DrawFloatingFakeController> controller_;
+ scoped_nsobject<DrawDetachedBarFakeController> controller_;
scoped_nsobject<BookmarkBarToolbarView> view_;
};
@@ -95,13 +94,13 @@ TEST_F(BookmarkBarToolbarViewTest, AddRemove) {
// Test drawing (part 1), mostly to ensure nothing leaks or crashes.
TEST_F(BookmarkBarToolbarViewTest, DisplayAsNormalBar) {
- [controller_.get() setDrawAsFloatingBar:NO];
+ [controller_.get() setIsShownAsDetachedBar:NO];
[view_ display];
}
// Test drawing (part 2), mostly to ensure nothing leaks or crashes.
-TEST_F(BookmarkBarToolbarViewTest, DisplayAsFloatingBarWithNoImage) {
- [controller_.get() setDrawAsFloatingBar:YES];
+TEST_F(BookmarkBarToolbarViewTest, DisplayAsDetachedBarWithNoImage) {
+ [controller_.get() setIsShownAsDetachedBar:YES];
// Tests where we don't have a background image, only a color.
MockThemeProvider provider;
@@ -114,7 +113,7 @@ TEST_F(BookmarkBarToolbarViewTest, DisplayAsFloatingBarWithNoImage) {
[view_ display];
}
-// Actions used in DisplayAsFloatingBarWithBgImage.
+// Actions used in DisplayAsDetachedBarWithBgImage.
ACTION(SetBackgroundTiling) {
*arg1 = BrowserThemeProvider::NO_REPEAT;
return true;
@@ -126,8 +125,8 @@ ACTION(SetAlignLeft) {
}
// Test drawing (part 3), mostly to ensure nothing leaks or crashes.
-TEST_F(BookmarkBarToolbarViewTest, DisplayAsFloatingBarWithBgImage) {
- [controller_.get() setDrawAsFloatingBar:YES];
+TEST_F(BookmarkBarToolbarViewTest, DisplayAsDetachedBarWithBgImage) {
+ [controller_.get() setIsShownAsDetachedBar:YES];
// Tests where we have a background image, with positioning information.
MockThemeProvider provider;
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_toolbar_view.mm ('k') | chrome/browser/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698