| 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/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 MockBridge(Profile* profile) | 36 MockBridge(Profile* profile) |
| 37 : HistoryMenuBridge(profile), | 37 : HistoryMenuBridge(profile), |
| 38 menu_([[NSMenu alloc] initWithTitle:@"History"]) {} | 38 menu_([[NSMenu alloc] initWithTitle:@"History"]) {} |
| 39 | 39 |
| 40 virtual NSMenu* HistoryMenu() OVERRIDE { | 40 virtual NSMenu* HistoryMenu() OVERRIDE { |
| 41 return menu_.get(); | 41 return menu_.get(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 scoped_nsobject<NSMenu> menu_; | 45 base::scoped_nsobject<NSMenu> menu_; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 class HistoryMenuBridgeTest : public CocoaProfileTest { | 48 class HistoryMenuBridgeTest : public CocoaProfileTest { |
| 49 public: | 49 public: |
| 50 | 50 |
| 51 virtual void SetUp() { | 51 virtual void SetUp() { |
| 52 CocoaProfileTest::SetUp(); | 52 CocoaProfileTest::SetUp(); |
| 53 profile()->CreateFaviconService(); | 53 profile()->CreateFaviconService(); |
| 54 bridge_.reset(new MockBridge(profile())); | 54 bridge_.reset(new MockBridge(profile())); |
| 55 } | 55 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 image_result.image = gfx::Image::CreateFrom1xBitmap(bitmap); | 356 image_result.image = gfx::Image::CreateFrom1xBitmap(bitmap); |
| 357 GotFaviconData(&item, image_result); | 357 GotFaviconData(&item, image_result); |
| 358 | 358 |
| 359 // Make sure the callback works. | 359 // Make sure the callback works. |
| 360 EXPECT_FALSE(item.icon_requested); | 360 EXPECT_FALSE(item.icon_requested); |
| 361 EXPECT_TRUE(item.icon.get()); | 361 EXPECT_TRUE(item.icon.get()); |
| 362 EXPECT_TRUE([item.menu_item image]); | 362 EXPECT_TRUE([item.menu_item image]); |
| 363 } | 363 } |
| 364 | 364 |
| 365 } // namespace | 365 } // namespace |
| OLD | NEW |