| 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())); | |
| 78 sidebar_manager->NavigateSidebar(tab, content_id_, url); | 75 sidebar_manager->NavigateSidebar(tab, content_id_, url); |
| 79 observer.Wait(); | 76 |
| 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()); |
| 80 } | 82 } |
| 81 | 83 |
| 82 void ShowSidebar(TabContents* tab) { | 84 void ShowSidebar(TabContents* tab) { |
| 83 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); | 85 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); |
| 84 sidebar_manager->ShowSidebar(tab, content_id_); | 86 sidebar_manager->ShowSidebar(tab, content_id_); |
| 85 } | 87 } |
| 86 | 88 |
| 87 void ExpandSidebar(TabContents* tab) { | 89 void ExpandSidebar(TabContents* tab) { |
| 88 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); | 90 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); |
| 89 sidebar_manager->ExpandSidebar(tab, content_id_); | 91 sidebar_manager->ExpandSidebar(tab, content_id_); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 ASSERT_TRUE(test_server()->Start()); | 192 ASSERT_TRUE(test_server()->Start()); |
| 191 | 193 |
| 192 ShowSidebarForCurrentTab(); | 194 ShowSidebarForCurrentTab(); |
| 193 | 195 |
| 194 NavigateSidebarForCurrentTabTo(kSimplePage); | 196 NavigateSidebarForCurrentTabTo(kSimplePage); |
| 195 | 197 |
| 196 HideSidebarForCurrentTab(); | 198 HideSidebarForCurrentTab(); |
| 197 } | 199 } |
| 198 | 200 |
| 199 } // namespace | 201 } // namespace |
| 202 |
| OLD | NEW |