| 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/bookmarks/bookmark_model.h" | 6 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 7 #include "chrome/browser/chrome_thread.h" | 7 #include "chrome/browser/chrome_thread.h" |
| 8 #include "chrome/browser/views/bookmark_bar_view.h" | 8 #include "chrome/browser/views/bookmark_bar_view.h" |
| 9 #include "chrome/test/browser_with_test_window_test.h" | 9 #include "chrome/test/browser_with_test_window_test.h" |
| 10 #include "chrome/test/testing_profile.h" | 10 #include "chrome/test/testing_profile.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 profile()->GetBookmarkModel()->AddURL( | 27 profile()->GetBookmarkModel()->AddURL( |
| 28 profile()->GetBookmarkModel()->GetBookmarkBarNode(), | 28 profile()->GetBookmarkModel()->GetBookmarkBarNode(), |
| 29 0, | 29 0, |
| 30 ASCIIToUTF16("blah"), | 30 ASCIIToUTF16("blah"), |
| 31 GURL("http://www.google.com")); | 31 GURL("http://www.google.com")); |
| 32 | 32 |
| 33 BookmarkBarView bookmark_bar(profile(), browser()); | 33 BookmarkBarView bookmark_bar(profile(), browser()); |
| 34 | 34 |
| 35 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount()); | 35 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount()); |
| 36 | 36 |
| 37 TestingProfile profile2(0); | 37 TestingProfile profile2; |
| 38 profile2.CreateBookmarkModel(true); | 38 profile2.CreateBookmarkModel(true); |
| 39 profile2.BlockUntilBookmarkModelLoaded(); | 39 profile2.BlockUntilBookmarkModelLoaded(); |
| 40 | 40 |
| 41 bookmark_bar.SetProfile(&profile2); | 41 bookmark_bar.SetProfile(&profile2); |
| 42 | 42 |
| 43 EXPECT_EQ(0, bookmark_bar.GetBookmarkButtonCount()); | 43 EXPECT_EQ(0, bookmark_bar.GetBookmarkButtonCount()); |
| 44 | 44 |
| 45 bookmark_bar.SetProfile(profile()); | 45 bookmark_bar.SetProfile(profile()); |
| 46 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount()); | 46 EXPECT_EQ(1, bookmark_bar.GetBookmarkButtonCount()); |
| 47 } | 47 } |
| OLD | NEW |