| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/app/chrome_command_ids.h" | 13 #include "chrome/app/chrome_command_ids.h" |
| 14 #include "chrome/browser/common/cancelable_request.h" | 14 #include "chrome/browser/common/cancelable_request.h" |
| 15 #include "chrome/browser/sessions/persistent_tab_restore_service.h" |
| 15 #include "chrome/browser/sessions/session_types_test_helper.h" | 16 #include "chrome/browser/sessions/session_types_test_helper.h" |
| 16 #include "chrome/browser/sessions/tab_restore_service.h" | |
| 17 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 17 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 18 #include "chrome/browser/ui/cocoa/history_menu_bridge.h" | 18 #include "chrome/browser/ui/cocoa/history_menu_bridge.h" |
| 19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #import "testing/gtest_mac.h" | 21 #import "testing/gtest_mac.h" |
| 22 #include "third_party/skia/include/core/SkBitmap.h" | 22 #include "third_party/skia/include/core/SkBitmap.h" |
| 23 #include "ui/gfx/codec/png_codec.h" | 23 #include "ui/gfx/codec/png_codec.h" |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class MockTRS : public TabRestoreService { | 27 class MockTRS : public PersistentTabRestoreService { |
| 28 public: | 28 public: |
| 29 MockTRS(Profile* profile) : TabRestoreService(profile, NULL) {} | 29 MockTRS(Profile* profile) : PersistentTabRestoreService(profile, NULL) {} |
| 30 MOCK_CONST_METHOD0(entries, const TabRestoreService::Entries&()); | 30 MOCK_CONST_METHOD0(entries, const TabRestoreService::Entries&()); |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 class MockBridge : public HistoryMenuBridge { | 33 class MockBridge : public HistoryMenuBridge { |
| 34 public: | 34 public: |
| 35 MockBridge(Profile* profile) | 35 MockBridge(Profile* profile) |
| 36 : HistoryMenuBridge(profile), | 36 : HistoryMenuBridge(profile), |
| 37 menu_([[NSMenu alloc] initWithTitle:@"History"]) {} | 37 menu_([[NSMenu alloc] initWithTitle:@"History"]) {} |
| 38 | 38 |
| 39 virtual NSMenu* HistoryMenu() { | 39 virtual NSMenu* HistoryMenu() { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 image_result.image = gfx::Image(bitmap); | 360 image_result.image = gfx::Image(bitmap); |
| 361 GotFaviconData(item.icon_handle, image_result); | 361 GotFaviconData(item.icon_handle, image_result); |
| 362 | 362 |
| 363 // Make sure the callback works. | 363 // Make sure the callback works. |
| 364 EXPECT_FALSE(item.icon_requested); | 364 EXPECT_FALSE(item.icon_requested); |
| 365 EXPECT_TRUE(item.icon.get()); | 365 EXPECT_TRUE(item.icon.get()); |
| 366 EXPECT_TRUE([item.menu_item image]); | 366 EXPECT_TRUE([item.menu_item image]); |
| 367 } | 367 } |
| 368 | 368 |
| 369 } // namespace | 369 } // namespace |
| OLD | NEW |