| OLD | NEW |
| 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 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 @end | 32 @end |
| 33 | 33 |
| 34 @implementation FakeBookmarkBarController | 34 @implementation FakeBookmarkBarController |
| 35 | 35 |
| 36 - (id)initWithBrowser:(Browser*)browser { | 36 - (id)initWithBrowser:(Browser*)browser { |
| 37 if ((self = [super initWithBrowser:browser | 37 if ((self = [super initWithBrowser:browser |
| 38 initialWidth:100 // arbitrary | 38 initialWidth:100 // arbitrary |
| 39 compressDelegate:nil | 39 compressDelegate:nil |
| 40 resizeDelegate:nil | 40 resizeDelegate:nil |
| 41 urlDelegate:self])) { | 41 urlDelegate:self |
| 42 commands:NULL])) { |
| 42 callbacks_.reset([[NSMutableArray alloc] init]); | 43 callbacks_.reset([[NSMutableArray alloc] init]); |
| 43 } | 44 } |
| 44 return self; | 45 return self; |
| 45 } | 46 } |
| 46 | 47 |
| 47 - (void)loaded:(BookmarkModel*)model { | 48 - (void)loaded:(BookmarkModel*)model { |
| 48 [callbacks_ addObject:[NSNumber numberWithInt:0]]; | 49 [callbacks_ addObject:[NSNumber numberWithInt:0]]; |
| 49 } | 50 } |
| 50 | 51 |
| 51 - (void)beingDeleted:(BookmarkModel*)model { | 52 - (void)beingDeleted:(BookmarkModel*)model { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 bridge->BookmarkNodeRemoved(NULL, NULL, 0, NULL); | 129 bridge->BookmarkNodeRemoved(NULL, NULL, 0, NULL); |
| 129 | 130 |
| 130 // 8 calls above plus an initial Loaded() in init routine makes 9 | 131 // 8 calls above plus an initial Loaded() in init routine makes 9 |
| 131 EXPECT_TRUE([controller.get()->callbacks_ count] == 9); | 132 EXPECT_TRUE([controller.get()->callbacks_ count] == 9); |
| 132 | 133 |
| 133 for (int x = 1; x < 9; x++) { | 134 for (int x = 1; x < 9; x++) { |
| 134 NSNumber *num = [NSNumber numberWithInt:x-1]; | 135 NSNumber *num = [NSNumber numberWithInt:x-1]; |
| 135 EXPECT_TRUE([[controller.get()->callbacks_ objectAtIndex:x] isEqual:num]); | 136 EXPECT_TRUE([[controller.get()->callbacks_ objectAtIndex:x] isEqual:num]); |
| 136 } | 137 } |
| 137 } | 138 } |
| OLD | NEW |