| 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 17 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |