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

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

Issue 101203012: [chromedriver] Add an error autoreporting feature that automatically raises errors from browser logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from review Created 6 years, 11 months 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/chromedriver/session.h ('k') | chrome/test/chromedriver/session_commands.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/test/chromedriver/session.h ('k') | chrome/test/chromedriver/session_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698