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

Unified Diff: chrome/test/webdriver/webdriver_session.cc

Issue 7648053: [chromedriver] Add chrome.detach option for configuring Chrome not to quit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win compile issue 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/webdriver/webdriver_session.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/webdriver_session.cc
diff --git a/chrome/test/webdriver/webdriver_session.cc b/chrome/test/webdriver/webdriver_session.cc
index efd7b1ef6e6d651550b9e9430c5937a893250ee3..f93ed46eda50406bec4d3bfed862f9783131121a 100644
--- a/chrome/test/webdriver/webdriver_session.cc
+++ b/chrome/test/webdriver/webdriver_session.cc
@@ -93,15 +93,29 @@ Error* Session::Init(const Automation::BrowserOptions& options) {
}
Error* Session::BeforeExecuteCommand() {
+ Error* error = AfterExecuteCommand();
+ if (!error) {
+ scoped_ptr<Error> switch_error(SwitchToTopFrameIfCurrentFrameInvalid());
+ if (switch_error.get()) {
+ std::string text;
+ scoped_ptr<Error> alert_error(GetAlertMessage(&text));
+ if (alert_error.get()) {
+ // Only return a frame checking error if a modal dialog is not present.
+ // TODO(kkania): This is ugly. Fix.
+ return switch_error.release();
+ }
+ }
+ }
+ return error;
+}
+
+Error* Session::AfterExecuteCommand() {
Error* error = NULL;
if (!options_.load_async) {
LOG(INFO) << "Waiting for the page to stop loading";
error = WaitForAllTabsToStopLoading();
LOG(INFO) << "Done waiting for the page to stop loading";
}
- if (!error) {
- error = SwitchToTopFrameIfCurrentFrameInvalid();
- }
return error;
}
« no previous file with comments | « chrome/test/webdriver/webdriver_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698