| 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 #import "testing/gtest_mac.h" |
| 10 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
| 11 | 12 |
| 12 // TODO(jrg): add OCMock to Chromium to save some typing. | 13 // TODO(jrg): add OCMock to Chromium to save some typing. |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 // Information needed to open a URL, as passed to the | 17 // Information needed to open a URL, as passed to the |
| 17 // BookmarkBarController's delegate. | 18 // BookmarkBarController's delegate. |
| 18 typedef std::pair<GURL,WindowOpenDisposition> OpenInfo; | 19 typedef std::pair<GURL,WindowOpenDisposition> OpenInfo; |
| 19 | 20 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 bridge->BookmarkNodeAdded(NULL, NULL, 0); | 122 bridge->BookmarkNodeAdded(NULL, NULL, 0); |
| 122 bridge->BookmarkNodeChanged(NULL, NULL); | 123 bridge->BookmarkNodeChanged(NULL, NULL); |
| 123 bridge->BookmarkNodeFavIconLoaded(NULL, NULL); | 124 bridge->BookmarkNodeFavIconLoaded(NULL, NULL); |
| 124 bridge->BookmarkNodeChildrenReordered(NULL, NULL); | 125 bridge->BookmarkNodeChildrenReordered(NULL, NULL); |
| 125 bridge->BookmarkNodeRemoved(NULL, NULL, 0, NULL); | 126 bridge->BookmarkNodeRemoved(NULL, NULL, 0, NULL); |
| 126 | 127 |
| 127 // 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 |
| 128 EXPECT_TRUE([controller.get()->callbacks_ count] == 9); | 129 EXPECT_TRUE([controller.get()->callbacks_ count] == 9); |
| 129 | 130 |
| 130 for (int x = 1; x < 9; x++) { | 131 for (int x = 1; x < 9; x++) { |
| 131 NSNumber *num = [NSNumber numberWithInt:x-1]; | 132 NSNumber* num = [NSNumber numberWithInt:x-1]; |
| 132 EXPECT_TRUE([[controller.get()->callbacks_ objectAtIndex:x] isEqual:num]); | 133 EXPECT_NSEQ(num, [controller.get()->callbacks_ objectAtIndex:x]); |
| 133 } | 134 } |
| 134 } | 135 } |
| OLD | NEW |