Index: chrome/test/ui_test_utils.cc |
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc |
index ac553804eacce38dd9a038c8730ff359cbf13e85..df979f3642db577cf5aa6b8aad836090bdb36ea8 100644 |
--- a/chrome/test/ui_test_utils.cc |
+++ b/chrome/test/ui_test_utils.cc |
@@ -120,7 +120,7 @@ class DownloadsCompleteObserver : public DownloadManager::Observer, |
// CheckAllDownloadsComplete will be called when the DownloadManager |
// fires it's ModelChanged() call, and also when incomplete downloads |
- // fire their OnDownloadUpdated(). |
+ // fire their OnDownloadUpdated(). |
bool CheckAllDownloadsComplete() { |
if (downloads_.size() < wait_count_) |
return false; |
@@ -208,6 +208,17 @@ void RunMessageLoop() { |
loop->SetNestableTasksAllowed(did_allow_task_nesting); |
} |
+bool GetCurrentTabTitle(const Browser* browser, string16* title) { |
+ TabContents* tab_contents = browser->GetSelectedTabContents(); |
+ if (!tab_contents) |
+ return false; |
+ NavigationEntry* last_entry = tab_contents->controller().GetActiveEntry(); |
+ if (!last_entry) |
+ return false; |
+ title->assign(last_entry->title()); |
+ return true; |
+} |
+ |
void WaitForNavigation(NavigationController* controller) { |
WaitForNavigations(controller, 1); |
} |
@@ -230,6 +241,15 @@ void NavigateToURLBlockUntilNavigationsComplete(Browser* browser, |
WaitForNavigations(controller, number_of_navigations); |
} |
+bool ReloadCurrentTab(Browser* browser) { |
+ browser->Reload(); |
+ TabContents* tab_contents = browser->GetSelectedTabContents(); |
+ if (!tab_contents) |
+ return false; |
+ WaitForNavigation(&tab_contents->controller()); |
+ return true; |
+} |
+ |
Value* ExecuteJavaScript(RenderViewHost* render_view_host, |
const std::wstring& frame_xpath, |
const std::wstring& original_script) { |