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

Unified Diff: chrome/test/chromedriver/session_commands.cc

Issue 1827003004: [Chromedriver] Chromedriver should handle unexpected alert automatically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make ignore value as default & fix nits. Created 4 years, 1 month 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
Index: chrome/test/chromedriver/session_commands.cc
diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc
index 64d9e97dc7f79c78889ab6fae712a056951e9a77..7601e0122c8f702053fcc32364a0103032c6b8ae 100644
--- a/chrome/test/chromedriver/session_commands.cc
+++ b/chrome/test/chromedriver/session_commands.cc
@@ -128,6 +128,10 @@ std::unique_ptr<base::DictionaryValue> CreateCapabilities(Chrome* chrome) {
caps->SetBoolean("nativeEvents", true);
caps->SetBoolean("hasTouchScreen", chrome->HasTouchScreen());
+ Session* session = GetThreadLocalSession();
+ caps->SetString("unexpectedAlertBehaviour",
+ session->GetUnexpectedAlertBehaviour());
+
ChromeDesktopImpl* desktop = NULL;
Status status = chrome->GetAsDesktop(&desktop);
if (status.IsOk()) {
@@ -187,6 +191,9 @@ Status InitSessionHelper(const InitSessionParams& bound_params,
if (status.IsError())
return status;
+ desired_caps->GetString("unexpectedAlertBehaviour",
+ &session->unexpected_alert_behaviour);
+
Log::Level driver_level = Log::kWarning;
if (capabilities.logging_prefs.count(WebDriverLog::kDriverType))
driver_level = capabilities.logging_prefs[WebDriverLog::kDriverType];

Powered by Google App Engine
This is Rietveld 408576698