Chromium Code Reviews| Index: chrome/test/chromedriver/session.cc |
| diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc |
| index a133832da828345795d6539d25a173453ac83cca..85df4981da30aea32f8338284b8fd12c73a17ad7 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().compare(WebDriverLog::kBrowserType) == 0) { |
|
chrisgao (Use stgao instead)
2014/01/09 22:11:55
(*it)->type() == WebDriverLog::kBrowserType ?
samuong
2014/01/16 00:29:28
Done.
|
| + std::string message = (*it)->GetFirstErrorMessage(); |
| + if (!message.empty()) |
| + return message; |
| + } |
| + } |
| + return ""; |
|
chrisgao (Use stgao instead)
2014/01/09 22:11:55
"" -> std::string()
samuong
2014/01/16 00:29:28
Done.
|
| +} |
| + |
| Session* GetThreadLocalSession() { |
| return lazy_tls_session.Pointer()->Get(); |
| } |