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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/sidebar/sidebar_manager.h" | 10 #include "chrome/browser/sidebar/sidebar_manager.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 HideSidebar(browser()->GetSelectedTabContents()); | 65 HideSidebar(browser()->GetSelectedTabContents()); |
66 } | 66 } |
67 | 67 |
68 void NavigateSidebarForCurrentTabTo(const std::string& test_page) { | 68 void NavigateSidebarForCurrentTabTo(const std::string& test_page) { |
69 GURL url = test_server()->GetURL(test_page); | 69 GURL url = test_server()->GetURL(test_page); |
70 | 70 |
71 TabContents* tab = browser()->GetSelectedTabContents(); | 71 TabContents* tab = browser()->GetSelectedTabContents(); |
72 | 72 |
73 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); | 73 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); |
74 | 74 |
| 75 ui_test_utils::WindowedNotificationObserver observer( |
| 76 content::NOTIFICATION_LOAD_STOP, |
| 77 Source<NavigationController>(&tab->controller())); |
75 sidebar_manager->NavigateSidebar(tab, content_id_, url); | 78 sidebar_manager->NavigateSidebar(tab, content_id_, url); |
76 | 79 observer.Wait(); |
77 SidebarContainer* sidebar_container = | |
78 sidebar_manager->GetSidebarContainerFor(tab, content_id_); | |
79 | |
80 TabContents* client_contents = sidebar_container->sidebar_contents(); | |
81 ui_test_utils::WaitForNavigation(&client_contents->controller()); | |
82 } | 80 } |
83 | 81 |
84 void ShowSidebar(TabContents* tab) { | 82 void ShowSidebar(TabContents* tab) { |
85 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); | 83 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); |
86 sidebar_manager->ShowSidebar(tab, content_id_); | 84 sidebar_manager->ShowSidebar(tab, content_id_); |
87 } | 85 } |
88 | 86 |
89 void ExpandSidebar(TabContents* tab) { | 87 void ExpandSidebar(TabContents* tab) { |
90 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); | 88 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); |
91 sidebar_manager->ExpandSidebar(tab, content_id_); | 89 sidebar_manager->ExpandSidebar(tab, content_id_); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 ASSERT_TRUE(test_server()->Start()); | 190 ASSERT_TRUE(test_server()->Start()); |
193 | 191 |
194 ShowSidebarForCurrentTab(); | 192 ShowSidebarForCurrentTab(); |
195 | 193 |
196 NavigateSidebarForCurrentTabTo(kSimplePage); | 194 NavigateSidebarForCurrentTabTo(kSimplePage); |
197 | 195 |
198 HideSidebarForCurrentTab(); | 196 HideSidebarForCurrentTab(); |
199 } | 197 } |
200 | 198 |
201 } // namespace | 199 } // namespace |
202 | |
OLD | NEW |