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 "base/mac/scoped_nsobject.h" | 5 #import "base/mac/scoped_nsobject.h" |
6 #include "base/strings/string16.h" | 6 #include "base/strings/string16.h" |
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" | 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" |
10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 BOOL opened_off_the_record; | 25 BOOL opened_off_the_record; |
26 } | 26 } |
27 - (id)initWithProfile:(Profile*)profile; | 27 - (id)initWithProfile:(Profile*)profile; |
28 @end | 28 @end |
29 | 29 |
30 @implementation FakeBookmarkMenuController | 30 @implementation FakeBookmarkMenuController |
31 | 31 |
32 - (id)initWithProfile:(Profile*)profile { | 32 - (id)initWithProfile:(Profile*)profile { |
33 if ((self = [super init])) { | 33 if ((self = [super init])) { |
34 base::string16 empty; | 34 base::string16 empty; |
35 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); | 35 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile); |
36 const BookmarkNode* bookmark_bar = model->bookmark_bar_node(); | 36 const BookmarkNode* bookmark_bar = model->bookmark_bar_node(); |
37 nodes_[0] = model->AddURL(bookmark_bar, 0, empty, GURL("http://0.com")); | 37 nodes_[0] = model->AddURL(bookmark_bar, 0, empty, GURL("http://0.com")); |
38 nodes_[1] = model->AddURL(bookmark_bar, 1, empty, GURL("http://1.com")); | 38 nodes_[1] = model->AddURL(bookmark_bar, 1, empty, GURL("http://1.com")); |
39 } | 39 } |
40 return self; | 40 return self; |
41 } | 41 } |
42 | 42 |
43 - (const BookmarkNode*)nodeForIdentifier:(int)identifier { | 43 - (const BookmarkNode*)nodeForIdentifier:(int)identifier { |
44 if ((identifier < 0) || (identifier >= 2)) | 44 if ((identifier < 0) || (identifier >= 2)) |
45 return NULL; | 45 return NULL; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 EXPECT_NE(c->opened_new_foreground_tab, NO); | 101 EXPECT_NE(c->opened_new_foreground_tab, NO); |
102 | 102 |
103 EXPECT_EQ(c->opened_new_window, NO); | 103 EXPECT_EQ(c->opened_new_window, NO); |
104 [c openAllBookmarksNewWindow:item]; | 104 [c openAllBookmarksNewWindow:item]; |
105 EXPECT_NE(c->opened_new_window, NO); | 105 EXPECT_NE(c->opened_new_window, NO); |
106 | 106 |
107 EXPECT_EQ(c->opened_off_the_record, NO); | 107 EXPECT_EQ(c->opened_off_the_record, NO); |
108 [c openAllBookmarksIncognitoWindow:item]; | 108 [c openAllBookmarksIncognitoWindow:item]; |
109 EXPECT_NE(c->opened_off_the_record, NO); | 109 EXPECT_NE(c->opened_off_the_record, NO); |
110 } | 110 } |
OLD | NEW |