OLD | NEW |
1 // Copyright (c) 2010 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 #include "base/scoped_nsobject.h" | 5 #include "base/scoped_nsobject.h" |
6 #include "base/scoped_ptr.h" | 6 #include "base/scoped_ptr.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/ui/cocoa/browser_test_helper.h" | 10 #include "chrome/browser/ui/cocoa/browser_test_helper.h" |
11 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 11 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
12 #include "chrome/browser/ui/cocoa/history_menu_bridge.h" | 12 #include "chrome/browser/ui/cocoa/history_menu_bridge.h" |
13 #include "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h" | 13 #include "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h" |
14 #include "chrome/browser/ui/browser.h" | |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
16 | 15 |
17 @interface FakeHistoryMenuController : HistoryMenuCocoaController { | 16 @interface FakeHistoryMenuController : HistoryMenuCocoaController { |
18 @public | 17 @public |
19 BOOL opened_[2]; | 18 BOOL opened_[2]; |
20 } | 19 } |
21 @end | 20 @end |
22 | 21 |
23 @implementation FakeHistoryMenuController | 22 @implementation FakeHistoryMenuController |
24 | 23 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 std::map<NSMenuItem*, HistoryMenuBridge::HistoryItem*>::iterator it = | 81 std::map<NSMenuItem*, HistoryMenuBridge::HistoryItem*>::iterator it = |
83 items.begin(); | 82 items.begin(); |
84 | 83 |
85 for ( ; it != items.end(); ++it) { | 84 for ( ; it != items.end(); ++it) { |
86 HistoryMenuBridge::HistoryItem* item = it->second; | 85 HistoryMenuBridge::HistoryItem* item = it->second; |
87 EXPECT_FALSE(controller()->opened_[item->session_id]); | 86 EXPECT_FALSE(controller()->opened_[item->session_id]); |
88 [controller() openHistoryMenuItem:it->first]; | 87 [controller() openHistoryMenuItem:it->first]; |
89 EXPECT_TRUE(controller()->opened_[item->session_id]); | 88 EXPECT_TRUE(controller()->opened_[item->session_id]); |
90 } | 89 } |
91 } | 90 } |
OLD | NEW |