| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #import "base/scoped_nsobject.h" | 7 #import "base/scoped_nsobject.h" |
| 8 #import "chrome/browser/cocoa/tab_controller.h" | 8 #import "chrome/browser/cocoa/tab_controller.h" |
| 9 #import "chrome/browser/cocoa/tab_controller_target.h" | 9 #import "chrome/browser/cocoa/tab_controller_target.h" |
| 10 #include "chrome/browser/cocoa/cocoa_test_helper.h" | 10 #include "chrome/browser/cocoa/cocoa_test_helper.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 pressure:1.0]; | 50 pressure:1.0]; |
| 51 [window postEvent:up atStart:YES]; | 51 [window postEvent:up atStart:YES]; |
| 52 } | 52 } |
| 53 - (void)commandDispatch:(TabStripModel::ContextMenuCommand)command | 53 - (void)commandDispatch:(TabStripModel::ContextMenuCommand)command |
| 54 forController:(TabController*)controller { | 54 forController:(TabController*)controller { |
| 55 } | 55 } |
| 56 - (BOOL)isCommandEnabled:(TabStripModel::ContextMenuCommand)command | 56 - (BOOL)isCommandEnabled:(TabStripModel::ContextMenuCommand)command |
| 57 forController:(TabController*)controller { | 57 forController:(TabController*)controller { |
| 58 return NO; | 58 return NO; |
| 59 } | 59 } |
| 60 - (NSInteger)indexForTabController:(TabController*)controller |
| 61 inTotal:(NSInteger*)total { |
| 62 if (total) |
| 63 *total = 1; |
| 64 return 0; |
| 65 } |
| 60 @end | 66 @end |
| 61 | 67 |
| 62 namespace { | 68 namespace { |
| 63 | 69 |
| 64 // The dragging code in TabView makes heavy use of autorelease pools so | 70 // The dragging code in TabView makes heavy use of autorelease pools so |
| 65 // inherit from CocoaTest to have one created for us. | 71 // inherit from CocoaTest to have one created for us. |
| 66 class TabControllerTest : public CocoaTest { | 72 class TabControllerTest : public CocoaTest { |
| 67 public: | 73 public: |
| 68 TabControllerTest() { } | 74 TabControllerTest() { } |
| 69 }; | 75 }; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 int cap = [controller iconCapacity]; | 264 int cap = [controller iconCapacity]; |
| 259 EXPECT_GT(cap, 0); | 265 EXPECT_GT(cap, 0); |
| 260 | 266 |
| 261 // Asking the view for its menu should yield a valid menu. | 267 // Asking the view for its menu should yield a valid menu. |
| 262 NSMenu* menu = [[controller view] menu]; | 268 NSMenu* menu = [[controller view] menu]; |
| 263 EXPECT_TRUE(menu); | 269 EXPECT_TRUE(menu); |
| 264 EXPECT_GT([menu numberOfItems], 0); | 270 EXPECT_GT([menu numberOfItems], 0); |
| 265 } | 271 } |
| 266 | 272 |
| 267 } // namespace | 273 } // namespace |
| OLD | NEW |