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

Side by Side Diff: chrome/browser/cocoa/bookmark_bar_bridge_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 unified diff | Download patch
« no previous file with comments | « chrome/browser/cocoa/animatable_view.h ('k') | chrome/browser/cocoa/bookmark_bar_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/cocoa/bookmark_bar_bridge.h" 5 #include "chrome/browser/cocoa/bookmark_bar_bridge.h"
6 #include "chrome/browser/cocoa/bookmark_bar_controller.h" 6 #include "chrome/browser/cocoa/bookmark_bar_controller.h"
7 #include "chrome/browser/cocoa/browser_test_helper.h" 7 #include "chrome/browser/cocoa/browser_test_helper.h"
8 #include "chrome/browser/cocoa/cocoa_test_helper.h" 8 #include "chrome/browser/cocoa/cocoa_test_helper.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
(...skipping 17 matching lines...) Expand all
28 scoped_nsobject<NSMutableArray> callbacks_; 28 scoped_nsobject<NSMutableArray> callbacks_;
29 std::vector<OpenInfo> opens_; 29 std::vector<OpenInfo> opens_;
30 } 30 }
31 @end 31 @end
32 32
33 @implementation FakeBookmarkBarController 33 @implementation FakeBookmarkBarController
34 34
35 - (id)initWithBrowser:(Browser*)browser { 35 - (id)initWithBrowser:(Browser*)browser {
36 if ((self = [super initWithBrowser:browser 36 if ((self = [super initWithBrowser:browser
37 initialWidth:100 // arbitrary 37 initialWidth:100 // arbitrary
38 compressDelegate:nil 38 delegate:nil
39 resizeDelegate:nil])) { 39 resizeDelegate:nil])) {
40 callbacks_.reset([[NSMutableArray alloc] init]); 40 callbacks_.reset([[NSMutableArray alloc] init]);
41 } 41 }
42 return self; 42 return self;
43 } 43 }
44 44
45 - (void)loaded:(BookmarkModel*)model { 45 - (void)loaded:(BookmarkModel*)model {
46 [callbacks_ addObject:[NSNumber numberWithInt:0]]; 46 [callbacks_ addObject:[NSNumber numberWithInt:0]];
47 } 47 }
48 48
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 bridge->BookmarkNodeRemoved(NULL, NULL, 0, NULL); 126 bridge->BookmarkNodeRemoved(NULL, NULL, 0, NULL);
127 127
128 // 8 calls above plus an initial Loaded() in init routine makes 9 128 // 8 calls above plus an initial Loaded() in init routine makes 9
129 EXPECT_TRUE([controller.get()->callbacks_ count] == 9); 129 EXPECT_TRUE([controller.get()->callbacks_ count] == 9);
130 130
131 for (int x = 1; x < 9; x++) { 131 for (int x = 1; x < 9; x++) {
132 NSNumber *num = [NSNumber numberWithInt:x-1]; 132 NSNumber *num = [NSNumber numberWithInt:x-1];
133 EXPECT_TRUE([[controller.get()->callbacks_ objectAtIndex:x] isEqual:num]); 133 EXPECT_TRUE([[controller.get()->callbacks_ objectAtIndex:x] isEqual:num]);
134 } 134 }
135 } 135 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/animatable_view.h ('k') | chrome/browser/cocoa/bookmark_bar_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698