OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/bookmarks/bookmark_model.h" | 5 #include "chrome/browser/bookmarks/bookmark_model.h" |
6 #include "chrome/browser/chrome_thread.h" | 6 #include "chrome/browser/chrome_thread.h" |
7 #include "chrome/browser/views/bookmark_bar_view.h" | 7 #include "chrome/browser/views/bookmark_bar_view.h" |
8 #include "chrome/test/browser_with_test_window_test.h" | 8 #include "chrome/test/browser_with_test_window_test.h" |
9 #include "chrome/test/testing_profile.h" | 9 #include "chrome/test/testing_profile.h" |
10 | 10 |
11 class BookmarkBarViewTest : public BrowserWithTestWindowTest { | 11 class BookmarkBarViewTest : public BrowserWithTestWindowTest { |
12 public: | 12 public: |
13 BookmarkBarViewTest() | 13 BookmarkBarViewTest() |
14 : file_thread_(ChromeThread::FILE, message_loop()) {} | 14 : ui_thread_(ChromeThread::UI, message_loop()), |
| 15 file_thread_(ChromeThread::FILE, message_loop()) {} |
15 | 16 |
16 private: | 17 private: |
| 18 ChromeThread ui_thread_; |
17 ChromeThread file_thread_; | 19 ChromeThread file_thread_; |
18 | 20 |
19 DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewTest); | 21 DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewTest); |
20 }; | 22 }; |
21 | 23 |
22 TEST_F(BookmarkBarViewTest, SwitchProfile) { | 24 TEST_F(BookmarkBarViewTest, SwitchProfile) { |
23 profile()->CreateBookmarkModel(true); | 25 profile()->CreateBookmarkModel(true); |
24 profile()->BlockUntilBookmarkModelLoaded(); | 26 profile()->BlockUntilBookmarkModelLoaded(); |
25 | 27 |
26 profile()->GetBookmarkModel()->AddURL( | 28 profile()->GetBookmarkModel()->AddURL( |
(...skipping 10 matching lines...) Expand all Loading... |
37 profile2.CreateBookmarkModel(true); | 39 profile2.CreateBookmarkModel(true); |
38 profile2.BlockUntilBookmarkModelLoaded(); | 40 profile2.BlockUntilBookmarkModelLoaded(); |
39 | 41 |
40 bookmark_bar.SetProfile(&profile2); | 42 bookmark_bar.SetProfile(&profile2); |
41 | 43 |
42 EXPECT_EQ(0, bookmark_bar.GetBookmarkButtonCount()); | 44 EXPECT_EQ(0, bookmark_bar.GetBookmarkButtonCount()); |
43 | 45 |
44 bookmark_bar.SetProfile(profile()); | 46 bookmark_bar.SetProfile(profile()); |
45 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount()); | 47 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount()); |
46 } | 48 } |
OLD | NEW |