OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 file_thread_(BrowserThread::FILE, &message_loop_) { | 35 file_thread_(BrowserThread::FILE, &message_loop_) { |
36 } | 36 } |
37 | 37 |
38 virtual void SetUp() OVERRIDE { | 38 virtual void SetUp() OVERRIDE { |
39 profile_.reset(new TestingProfile()); | 39 profile_.reset(new TestingProfile()); |
40 profile_->CreateBookmarkModel(true); | 40 profile_->CreateBookmarkModel(true); |
41 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); | 41 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); |
42 ui_test_utils::WaitForBookmarkModelToLoad(model_); | 42 ui_test_utils::WaitForBookmarkModelToLoad(model_); |
43 | 43 |
44 Browser::CreateParams native_params(profile_.get(), | 44 Browser::CreateParams native_params(profile_.get(), |
45 chrome::HOST_DESKTOP_TYPE_NATIVE); | 45 chrome::GetActiveDesktop()); |
46 browser_.reset( | 46 browser_.reset( |
47 chrome::CreateBrowserWithTestWindowForParams(&native_params)); | 47 chrome::CreateBrowserWithTestWindowForParams(&native_params)); |
48 origin_provider_.reset(new EmptyTabstripOriginProvider); | 48 origin_provider_.reset(new EmptyTabstripOriginProvider); |
49 bookmark_bar_.reset(new BookmarkBarGtk(NULL, browser_.get(), | 49 bookmark_bar_.reset(new BookmarkBarGtk(NULL, browser_.get(), |
50 origin_provider_.get())); | 50 origin_provider_.get())); |
51 } | 51 } |
52 | 52 |
53 virtual void TearDown() OVERRIDE { | 53 virtual void TearDown() OVERRIDE { |
54 message_loop_.RunUntilIdle(); | 54 message_loop_.RunUntilIdle(); |
55 | 55 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 ASCIIToUTF16("other"), GURL("http://two.com")); | 96 ASCIIToUTF16("other"), GURL("http://two.com")); |
97 | 97 |
98 bookmark_bar_->Loaded(model_, false); | 98 bookmark_bar_->Loaded(model_, false); |
99 | 99 |
100 // We should expect two children to the bookmark bar's toolbar. | 100 // We should expect two children to the bookmark bar's toolbar. |
101 GList* children = gtk_container_get_children( | 101 GList* children = gtk_container_get_children( |
102 GTK_CONTAINER(bookmark_bar_->bookmark_toolbar_.get())); | 102 GTK_CONTAINER(bookmark_bar_->bookmark_toolbar_.get())); |
103 EXPECT_EQ(2U, g_list_length(children)); | 103 EXPECT_EQ(2U, g_list_length(children)); |
104 g_list_free(children); | 104 g_list_free(children); |
105 } | 105 } |
OLD | NEW |