Index: chrome/test/chromedriver/session.cc |
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc |
index a133832da828345795d6539d25a173453ac83cca..91370da1d3b451059eb45ffad274af78f9a86e53 100644 |
--- a/chrome/test/chromedriver/session.cc |
+++ b/chrome/test/chromedriver/session.cc |
@@ -39,7 +39,8 @@ Session::Session(const std::string& id) |
force_devtools_screenshot(false), |
sticky_modifiers(0), |
mouse_position(0, 0), |
- page_load_timeout(kDefaultPageLoadTimeout) {} |
+ page_load_timeout(kDefaultPageLoadTimeout), |
+ auto_reporting_enabled(false) {} |
Session::Session(const std::string& id, scoped_ptr<Chrome> chrome) |
: id(id), |
@@ -49,7 +50,8 @@ Session::Session(const std::string& id, scoped_ptr<Chrome> chrome) |
chrome(chrome.Pass()), |
sticky_modifiers(0), |
mouse_position(0, 0), |
- page_load_timeout(kDefaultPageLoadTimeout) {} |
+ page_load_timeout(kDefaultPageLoadTimeout), |
+ auto_reporting_enabled(false) {} |
Session::~Session() {} |
@@ -93,6 +95,19 @@ std::vector<WebDriverLog*> Session::GetAllLogs() const { |
return logs; |
} |
+std::string Session::GetFirstBrowserError() const { |
+ for (ScopedVector<WebDriverLog>::const_iterator it = devtools_logs.begin(); |
+ it != devtools_logs.end(); |
+ ++it) { |
+ if ((*it)->type() == WebDriverLog::kBrowserType) { |
+ std::string message = (*it)->GetFirstErrorMessage(); |
+ if (!message.empty()) |
+ return message; |
+ } |
+ } |
+ return std::string(); |
+} |
+ |
Session* GetThreadLocalSession() { |
return lazy_tls_session.Pointer()->Get(); |
} |