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

Unified Diff: chrome/test/ui_test_utils.cc

Issue 149235: Convert crash recovery tests to browser test framework, which should reduce flakiness. (Closed)
Patch Set: extracted common things Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/ui_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « chrome/test/ui_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698