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 #include "chrome/browser/ui/cocoa/history_menu_bridge.h" | 5 #include "chrome/browser/ui/cocoa/history_menu_bridge.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include <initializer_list> | 9 #include <initializer_list> |
10 #include <memory> | 10 #include <memory> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 NSMenu* HistoryMenu() override { return menu_.get(); } | 48 NSMenu* HistoryMenu() override { return menu_.get(); } |
49 | 49 |
50 private: | 50 private: |
51 base::scoped_nsobject<NSMenu> menu_; | 51 base::scoped_nsobject<NSMenu> menu_; |
52 }; | 52 }; |
53 | 53 |
54 class HistoryMenuBridgeTest : public CocoaProfileTest { | 54 class HistoryMenuBridgeTest : public CocoaProfileTest { |
55 public: | 55 public: |
56 void SetUp() override { | 56 void SetUp() override { |
57 CocoaProfileTest::SetUp(); | 57 CocoaProfileTest::SetUp(); |
| 58 ASSERT_TRUE(profile()->CreateHistoryService(/*delete_file=*/true, |
| 59 /*no_db=*/false)); |
58 profile()->CreateFaviconService(); | 60 profile()->CreateFaviconService(); |
59 bridge_.reset(new MockBridge(profile())); | 61 bridge_.reset(new MockBridge(profile())); |
60 } | 62 } |
61 | 63 |
62 // We are a friend of HistoryMenuBridge (and have access to | 64 // We are a friend of HistoryMenuBridge (and have access to |
63 // protected methods), but none of the classes generated by TEST_F() | 65 // protected methods), but none of the classes generated by TEST_F() |
64 // are. Wraps common commands. | 66 // are. Wraps common commands. |
65 void ClearMenuSection(NSMenu* menu, | 67 void ClearMenuSection(NSMenu* menu, |
66 NSInteger tag) { | 68 NSInteger tag) { |
67 bridge_->ClearMenuSection(menu, tag); | 69 bridge_->ClearMenuSection(menu, tag); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 image_result.image = gfx::Image::CreateFrom1xBitmap(bitmap); | 364 image_result.image = gfx::Image::CreateFrom1xBitmap(bitmap); |
363 GotFaviconData(&item, image_result); | 365 GotFaviconData(&item, image_result); |
364 | 366 |
365 // Make sure the callback works. | 367 // Make sure the callback works. |
366 EXPECT_FALSE(item.icon_requested); | 368 EXPECT_FALSE(item.icon_requested); |
367 EXPECT_TRUE(item.icon.get()); | 369 EXPECT_TRUE(item.icon.get()); |
368 EXPECT_TRUE([item.menu_item image]); | 370 EXPECT_TRUE([item.menu_item image]); |
369 } | 371 } |
370 | 372 |
371 } // namespace | 373 } // namespace |
OLD | NEW |