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

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

Issue 7489019: Fix up various browser tests not to use WaitForNavigation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix nits 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()));
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
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
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