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