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

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

Issue 8943001: Fix mac chromedriver tests (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: ... Created 9 years 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/test/run_chromedriver_tests.py ('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_automation.cc
diff --git a/chrome/test/webdriver/webdriver_automation.cc b/chrome/test/webdriver/webdriver_automation.cc
index 36033481a65bc960c1d27f42b8d5c02bbc6408c5..7334c167225c57409c6a08b9b5a7eff6ffcde437 100644
--- a/chrome/test/webdriver/webdriver_automation.cc
+++ b/chrome/test/webdriver/webdriver_automation.cc
@@ -34,6 +34,7 @@
#include "chrome/test/automation/extension_proxy.h"
#include "chrome/test/automation/proxy_launcher.h"
#include "chrome/test/automation/tab_proxy.h"
+#include "chrome/test/base/chrome_process_util.h"
#include "chrome/test/webdriver/frame_path.h"
#include "chrome/test/webdriver/webdriver_basic_types.h"
#include "chrome/test/webdriver/webdriver_error.h"
@@ -302,7 +303,24 @@ void Automation::Init(const BrowserOptions& options, Error** error) {
void Automation::Terminate() {
if (launcher_.get() && launcher_->process() != base::kNullProcessHandle) {
- launcher_->QuitBrowser();
+#if defined(OS_MACOSX)
+ // There's currently no way to shutdown gracefully with mac chrome.
+ // An alert could be open or (open before shutdown is started) and stop
+ // the whole process. Close any current dialog, try to kill gently, and
+ // if all else fails, kill it hard.
+ Error* error = NULL;
+ AcceptOrDismissAppModalDialog(true /* accept */, &error);
+ scoped_ptr<Error> scoped_error(error);
+
+ kill(launcher_->process(), SIGTERM);
+ int exit_code = -1;
+ if (!launcher_->WaitForBrowserProcessToQuit(10000, &exit_code)) {
+ TerminateAllChromeProcesses(launcher_->process_id());
+ }
+ base::CloseProcessHandle(launcher_->process());
+#else
+ launcher_->TerminateBrowser();
+#endif
}
}
« no previous file with comments | « chrome/test/webdriver/test/run_chromedriver_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698