OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_nsobject.h" | 5 #include "base/memory/scoped_nsobject.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/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/cocoa_profile_test.h" | 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 @implementation FakeHistoryMenuController | 21 @implementation FakeHistoryMenuController |
22 | 22 |
23 - (id)initTest { | 23 - (id)initTest { |
24 if ((self = [super init])) { | 24 if ((self = [super init])) { |
25 opened_[0] = NO; | 25 opened_[0] = NO; |
26 opened_[1] = NO; | 26 opened_[1] = NO; |
27 } | 27 } |
28 return self; | 28 return self; |
29 } | 29 } |
30 | 30 |
31 - (void)openURLForItem:(const HistoryMenuBridge::HistoryItem*)item { | 31 - (void)openURLForItem:(HistoryMenuBridge::HistoryItem*)item { |
32 opened_[item->session_id] = YES; | 32 opened_[item->session_id] = YES; |
33 } | 33 } |
34 | 34 |
35 @end // FakeHistoryMenuController | 35 @end // FakeHistoryMenuController |
36 | 36 |
37 class HistoryMenuCocoaControllerTest : public CocoaProfileTest { | 37 class HistoryMenuCocoaControllerTest : public CocoaProfileTest { |
38 public: | 38 public: |
39 virtual void SetUp() OVERRIDE { | 39 virtual void SetUp() OVERRIDE { |
40 CocoaProfileTest::SetUp(); | 40 CocoaProfileTest::SetUp(); |
41 ASSERT_TRUE(profile()); | 41 ASSERT_TRUE(profile()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 std::map<NSMenuItem*, HistoryMenuBridge::HistoryItem*>::iterator it = | 79 std::map<NSMenuItem*, HistoryMenuBridge::HistoryItem*>::iterator it = |
80 items.begin(); | 80 items.begin(); |
81 | 81 |
82 for ( ; it != items.end(); ++it) { | 82 for ( ; it != items.end(); ++it) { |
83 HistoryMenuBridge::HistoryItem* item = it->second; | 83 HistoryMenuBridge::HistoryItem* item = it->second; |
84 EXPECT_FALSE(controller()->opened_[item->session_id]); | 84 EXPECT_FALSE(controller()->opened_[item->session_id]); |
85 [controller() openHistoryMenuItem:it->first]; | 85 [controller() openHistoryMenuItem:it->first]; |
86 EXPECT_TRUE(controller()->opened_[item->session_id]); | 86 EXPECT_TRUE(controller()->opened_[item->session_id]); |
87 } | 87 } |
88 } | 88 } |
OLD | NEW |