Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_unittest.mm

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Replace in .mm files Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698