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

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: Created 9 years, 5 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
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(tab->controller());
75 sidebar_manager->NavigateSidebar(tab, content_id_, url); 76 sidebar_manager->NavigateSidebar(tab, content_id_, url);
77 observer.Wait();
76 78
77 SidebarContainer* sidebar_container = 79 SidebarContainer* sidebar_container =
78 sidebar_manager->GetSidebarContainerFor(tab, content_id_); 80 sidebar_manager->GetSidebarContainerFor(tab, content_id_);
79 81
80 TabContents* client_contents = sidebar_container->sidebar_contents(); 82 TabContents* client_contents = sidebar_container->sidebar_contents();
81 ui_test_utils::WaitForNavigation(&client_contents->controller());
82 } 83 }
83 84
84 void ShowSidebar(TabContents* tab) { 85 void ShowSidebar(TabContents* tab) {
85 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); 86 SidebarManager* sidebar_manager = SidebarManager::GetInstance();
86 sidebar_manager->ShowSidebar(tab, content_id_); 87 sidebar_manager->ShowSidebar(tab, content_id_);
87 } 88 }
88 89
89 void ExpandSidebar(TabContents* tab) { 90 void ExpandSidebar(TabContents* tab) {
90 SidebarManager* sidebar_manager = SidebarManager::GetInstance(); 91 SidebarManager* sidebar_manager = SidebarManager::GetInstance();
91 sidebar_manager->ExpandSidebar(tab, content_id_); 92 sidebar_manager->ExpandSidebar(tab, content_id_);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 ASSERT_TRUE(test_server()->Start()); 193 ASSERT_TRUE(test_server()->Start());
193 194
194 ShowSidebarForCurrentTab(); 195 ShowSidebarForCurrentTab();
195 196
196 NavigateSidebarForCurrentTabTo(kSimplePage); 197 NavigateSidebarForCurrentTabTo(kSimplePage);
197 198
198 HideSidebarForCurrentTab(); 199 HideSidebarForCurrentTab();
199 } 200 }
200 201
201 } // namespace 202 } // namespace
202
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698