OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/ui/gtk/bookmarks/bookmark_bar_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h" |
6 | 6 |
7 #include "base/task.h" | 7 #include "base/task.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 file_thread_(BrowserThread::FILE, &message_loop_) { | 30 file_thread_(BrowserThread::FILE, &message_loop_) { |
31 } | 31 } |
32 | 32 |
33 virtual void SetUp() { | 33 virtual void SetUp() { |
34 profile_.reset(new TestingProfile()); | 34 profile_.reset(new TestingProfile()); |
35 profile_->CreateBookmarkModel(true); | 35 profile_->CreateBookmarkModel(true); |
36 profile_->BlockUntilBookmarkModelLoaded(); | 36 profile_->BlockUntilBookmarkModelLoaded(); |
37 browser_.reset(new Browser(Browser::TYPE_TABBED, profile_.get())); | 37 browser_.reset(new Browser(Browser::TYPE_TABBED, profile_.get())); |
38 | 38 |
39 origin_provider_.reset(new EmptyTabstripOriginProvider); | 39 origin_provider_.reset(new EmptyTabstripOriginProvider); |
40 bookmark_bar_.reset(new BookmarkBarGtk(NULL, profile_.get(), browser_.get(), | 40 bookmark_bar_.reset(new BookmarkBarGtk(NULL, browser_.get(), |
41 origin_provider_.get())); | 41 origin_provider_.get())); |
42 } | 42 } |
43 | 43 |
44 virtual void TearDown() { | 44 virtual void TearDown() { |
45 message_loop_.RunAllPending(); | 45 message_loop_.RunAllPending(); |
46 | 46 |
47 bookmark_bar_.reset(); | 47 bookmark_bar_.reset(); |
48 origin_provider_.reset(); | 48 origin_provider_.reset(); |
49 browser_.reset(); | 49 browser_.reset(); |
50 profile_.reset(); | 50 profile_.reset(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ASCIIToUTF16("other"), GURL("http://two.com")); | 90 ASCIIToUTF16("other"), GURL("http://two.com")); |
91 | 91 |
92 bookmark_bar_->Loaded(model, false); | 92 bookmark_bar_->Loaded(model, false); |
93 | 93 |
94 // We should expect two children to the bookmark bar's toolbar. | 94 // We should expect two children to the bookmark bar's toolbar. |
95 GList* children = gtk_container_get_children( | 95 GList* children = gtk_container_get_children( |
96 GTK_CONTAINER(bookmark_bar_->bookmark_toolbar_.get())); | 96 GTK_CONTAINER(bookmark_bar_->bookmark_toolbar_.get())); |
97 EXPECT_EQ(2U, g_list_length(children)); | 97 EXPECT_EQ(2U, g_list_length(children)); |
98 g_list_free(children); | 98 g_list_free(children); |
99 } | 99 } |
OLD | NEW |