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

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

Issue 8401007: Don't run the pre and post handlers after chromedriver receives a termination request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 2 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 74ad4a1877e7c5f5144366045af59f52248022df..c1c152467cf5f112ea9fc563227da65d34ebf0fd 100644
--- a/chrome/test/webdriver/webdriver_session.cc
+++ b/chrome/test/webdriver/webdriver_session.cc
@@ -67,6 +67,7 @@ Session::Session(const Options& options)
async_script_timeout_(0),
implicit_wait_(0),
has_alert_prompt_text_(false),
+ terminated_(false),
options_(options) {
SessionManager::GetInstance()->Add(this);
}
@@ -93,6 +94,8 @@ Error* Session::Init(const Automation::BrowserOptions& options) {
}
Error* Session::BeforeExecuteCommand() {
+ if (terminated_)
+ return NULL;
Error* error = AfterExecuteCommand();
if (!error) {
scoped_ptr<Error> switch_error(SwitchToTopFrameIfCurrentFrameInvalid());
@@ -110,6 +113,8 @@ Error* Session::BeforeExecuteCommand() {
}
Error* Session::AfterExecuteCommand() {
+ if (terminated_)
+ return NULL;
Error* error = NULL;
if (!options_.load_async) {
LOG(INFO) << "Waiting for the page to stop loading";
@@ -120,6 +125,7 @@ Error* Session::AfterExecuteCommand() {
}
void Session::Terminate() {
+ terminated_ = true;
RunSessionTask(NewRunnableMethod(
this,
&Session::TerminateOnSessionThread));
« 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