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

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

Issue 2822010: Fixes bug in bookmark bar view if profile changed. If the profile (Closed)
Patch Set: Created 10 years, 6 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
« no previous file with comments | « chrome/browser/views/bookmark_bar_view.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 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 "chrome/browser/bookmarks/bookmark_model.h"
6 #include "chrome/browser/chrome_thread.h"
7 #include "chrome/browser/views/bookmark_bar_view.h"
8 #include "chrome/test/browser_with_test_window_test.h"
9 #include "chrome/test/testing_profile.h"
10
11 class BookmarkBarViewTest : public BrowserWithTestWindowTest {
12 public:
13 BookmarkBarViewTest()
14 : ui_thread_(ChromeThread::UI, message_loop()),
15 file_thread_(ChromeThread::FILE, message_loop()) {}
16
17 private:
18 ChromeThread ui_thread_;
19 ChromeThread file_thread_;
20
21 DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewTest);
22 };
23
24 TEST_F(BookmarkBarViewTest, SwitchProfile) {
25 profile()->CreateBookmarkModel(true);
26 profile()->BlockUntilBookmarkModelLoaded();
27
28 profile()->GetBookmarkModel()->AddURL(
29 profile()->GetBookmarkModel()->GetBookmarkBarNode(),
30 0,
31 L"blah",
32 GURL("http://www.google.com"));
33
34 BookmarkBarView bookmark_bar(profile(), browser());
35
36 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount());
37
38 TestingProfile profile2(0);
39 profile2.CreateBookmarkModel(true);
40 profile2.BlockUntilBookmarkModelLoaded();
41
42 bookmark_bar.SetProfile(&profile2);
43
44 EXPECT_EQ(0, bookmark_bar.GetBookmarkButtonCount());
45
46 bookmark_bar.SetProfile(profile());
47 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount());
48 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bookmark_bar_view.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698