Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: chrome/browser/sidebar/sidebar_browsertest.cc

Issue 7633032: Revert 96593 - Fix up various browser tests not to use WaitForNavigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/pdf_browsertest.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/pdf_browsertest.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698