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/mac/scoped_nsobject.h" | 5 #include "base/mac/scoped_nsobject.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/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 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 - (void)openURLForItem:(const HistoryMenuBridge::HistoryItem*)item { | 32 - (void)openURLForItem:(const HistoryMenuBridge::HistoryItem*)item { |
33 opened_[item->session_id] = YES; | 33 opened_[item->session_id] = YES; |
34 } | 34 } |
35 | 35 |
36 @end // FakeHistoryMenuController | 36 @end // FakeHistoryMenuController |
37 | 37 |
38 class HistoryMenuCocoaControllerTest : public CocoaProfileTest { | 38 class HistoryMenuCocoaControllerTest : public CocoaProfileTest { |
39 public: | 39 public: |
40 virtual void SetUp() OVERRIDE { | 40 virtual void SetUp() override { |
41 CocoaProfileTest::SetUp(); | 41 CocoaProfileTest::SetUp(); |
42 ASSERT_TRUE(profile()); | 42 ASSERT_TRUE(profile()); |
43 | 43 |
44 bridge_.reset(new HistoryMenuBridge(profile())); | 44 bridge_.reset(new HistoryMenuBridge(profile())); |
45 bridge_->controller_.reset( | 45 bridge_->controller_.reset( |
46 [[FakeHistoryMenuController alloc] initWithBridge:bridge_.get()]); | 46 [[FakeHistoryMenuController alloc] initWithBridge:bridge_.get()]); |
47 [controller() initTest]; | 47 [controller() initTest]; |
48 } | 48 } |
49 | 49 |
50 void CreateItems(NSMenu* menu) { | 50 void CreateItems(NSMenu* menu) { |
(...skipping 29 matching lines...) Expand all Loading... |
80 std::map<NSMenuItem*, HistoryMenuBridge::HistoryItem*>::iterator it = | 80 std::map<NSMenuItem*, HistoryMenuBridge::HistoryItem*>::iterator it = |
81 items.begin(); | 81 items.begin(); |
82 | 82 |
83 for ( ; it != items.end(); ++it) { | 83 for ( ; it != items.end(); ++it) { |
84 HistoryMenuBridge::HistoryItem* item = it->second; | 84 HistoryMenuBridge::HistoryItem* item = it->second; |
85 EXPECT_FALSE(controller()->opened_[item->session_id]); | 85 EXPECT_FALSE(controller()->opened_[item->session_id]); |
86 [controller() openHistoryMenuItem:it->first]; | 86 [controller() openHistoryMenuItem:it->first]; |
87 EXPECT_TRUE(controller()->opened_[item->session_id]); | 87 EXPECT_TRUE(controller()->opened_[item->session_id]); |
88 } | 88 } |
89 } | 89 } |
OLD | NEW |