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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc

Issue 7574021: Remove frontend code that allows for dynamic profile setting, and read the profile off the browse... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/utf_string_conversions.h"
6 #include "chrome/browser/bookmarks/bookmark_model.h"
7 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
8 #include "chrome/test/base/browser_with_test_window_test.h"
9 #include "chrome/test/base/testing_profile.h"
10 #include "content/browser/browser_thread.h"
11
12 typedef BrowserWithTestWindowTest BookmarkBarViewTest;
13
14 TEST_F(BookmarkBarViewTest, SwitchProfile) {
15 profile()->CreateBookmarkModel(true);
16 profile()->BlockUntilBookmarkModelLoaded();
17
18 profile()->GetBookmarkModel()->AddURL(
19 profile()->GetBookmarkModel()->bookmark_bar_node(),
20 0,
21 ASCIIToUTF16("blah"),
22 GURL("http://www.google.com"));
23
24 BookmarkBarView bookmark_bar(profile(), browser());
25
26 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount());
27
28 TestingProfile profile2;
29 profile2.CreateBookmarkModel(true);
30 profile2.BlockUntilBookmarkModelLoaded();
31
32 bookmark_bar.SetProfile(&profile2);
33
34 EXPECT_EQ(0, bookmark_bar.GetBookmarkButtonCount());
35
36 bookmark_bar.SetProfile(profile());
37 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount());
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698