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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/avatar_icon_controller_unittest.mm

Issue 257003004: Remove dependency on bookmark_model_factory from bookmark_test_helpers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@364433
Patch Set: Fix unit tests on Linux & Windows Created 6 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
10 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" 11 #include "chrome/browser/bookmarks/bookmark_test_helpers.h"
11 #include "chrome/browser/managed_mode/managed_user_service.h" 12 #include "chrome/browser/managed_mode/managed_user_service.h"
12 #include "chrome/browser/managed_mode/managed_user_service_factory.h" 13 #include "chrome/browser/managed_mode/managed_user_service_factory.h"
13 #include "chrome/browser/prefs/pref_service_syncable.h" 14 #include "chrome/browser/prefs/pref_service_syncable.h"
14 #include "chrome/browser/search_engines/template_url_service_factory.h" 15 #include "chrome/browser/search_engines/template_url_service_factory.h"
15 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_commands.h" 17 #include "chrome/browser/ui/browser_commands.h"
17 #include "chrome/browser/ui/browser_window.h" 18 #include "chrome/browser/ui/browser_window.h"
18 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" 19 #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
19 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" 20 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 name, scoped_ptr<PrefServiceSyncable>(), base::ASCIIToUTF16(name), 0, 102 name, scoped_ptr<PrefServiceSyncable>(), base::ASCIIToUTF16(name), 0,
102 "asdf", TestingProfile::TestingFactories()); 103 "asdf", TestingProfile::TestingFactories());
103 EXPECT_TRUE(profile->IsManaged()); 104 EXPECT_TRUE(profile->IsManaged());
104 105
105 // http://crbug.com/39725 106 // http://crbug.com/39725
106 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( 107 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
107 profile, &TemplateURLServiceFactory::BuildInstanceFor); 108 profile, &TemplateURLServiceFactory::BuildInstanceFor);
108 AutocompleteClassifierFactory::GetInstance()->SetTestingFactoryAndUse( 109 AutocompleteClassifierFactory::GetInstance()->SetTestingFactoryAndUse(
109 profile, &AutocompleteClassifierFactory::BuildInstanceFor); 110 profile, &AutocompleteClassifierFactory::BuildInstanceFor);
110 profile->CreateBookmarkModel(true); 111 profile->CreateBookmarkModel(true);
111 test::WaitForBookmarkModelToLoad(profile); 112 test::WaitForBookmarkModelToLoad(
113 BookmarkModelFactory::GetForProfile(profile));
112 114
113 Browser* browser = 115 Browser* browser =
114 new Browser(Browser::CreateParams(profile, chrome::GetActiveDesktop())); 116 new Browser(Browser::CreateParams(profile, chrome::GetActiveDesktop()));
115 // Build a new controller to check if it is initialized correctly for a 117 // Build a new controller to check if it is initialized correctly for a
116 // managed user profile. 118 // managed user profile.
117 base::scoped_nsobject<AvatarIconController> controller( 119 base::scoped_nsobject<AvatarIconController> controller(
118 [[AvatarIconController alloc] initWithBrowser:browser]); 120 [[AvatarIconController alloc] initWithBrowser:browser]);
119 121
120 EXPECT_TRUE([controller labelButtonView]); 122 EXPECT_TRUE([controller labelButtonView]);
121 123
122 browser->window()->Close(); 124 browser->window()->Close();
123 } 125 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/cocoa_profile_test.mm ('k') | chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698