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

Unified Diff: chrome/test/chromedriver/session.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.cc
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc
index 90dad58854794aff88712275670d967c0506a76b..5feb0640b81e4913f8b6b4d1b892c59e45adf497 100644
--- a/chrome/test/chromedriver/session.cc
+++ b/chrome/test/chromedriver/session.cc
@@ -57,6 +57,18 @@ Session::Session(const std::string& id, std::unique_ptr<Chrome> chrome)
Session::~Session() {}
+//types of unexpected alert behaviour
+const char Session::kAccept[] = "accept";
+const char Session::kDismiss[] = "dismiss";
+const char Session::kIgnore[] = "ignore";
+
+std::string Session::GetUnexpectedAlertBehaviour() const {
+ if (unexpected_alert_behaviour.empty())
samuong 2016/11/22 19:52:16 is it possible for this to ever be set to the empt
gmanikpure 2016/11/23 18:34:26 Empty string can be set in DesiredCapabilities "dc
samuong 2016/11/23 21:28:01 There's no need for the "get_" prefix for this fun
gmanikpure 2016/11/23 22:04:10 Actually, I was getting multiple 'duplicate member
samuong 2016/11/23 22:11:00 Oh, I just realized that Session is a struct and n
gmanikpure 2016/11/23 22:24:31 Hmm, yeah. I missed noticing that, thanks for poin
+ return Session::kIgnore;
+ else
+ return unexpected_alert_behaviour;
+}
+
Status Session::GetTargetWindow(WebView** web_view) {
if (!chrome)
return Status(kNoSuchWindow, "no chrome started in this session");

Powered by Google App Engine
This is Rietveld 408576698