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

Unified Diff: chrome/test/chromedriver/logging.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/logging.h ('k') | chrome/test/chromedriver/logging_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/logging.cc
diff --git a/chrome/test/chromedriver/logging.cc b/chrome/test/chromedriver/logging.cc
index 5933f2a8c202cb85786bedfba5fb728b3444017e..94b3a460e3019cf22d34a416e8c9faa4739bfdc9 100644
--- a/chrome/test/chromedriver/logging.cc
+++ b/chrome/test/chromedriver/logging.cc
@@ -150,6 +150,26 @@ scoped_ptr<base::ListValue> WebDriverLog::GetAndClearEntries() {
return ret.Pass();
}
+std::string WebDriverLog::GetFirstErrorMessage() const {
+ for (base::ListValue::iterator it = entries_->begin();
+ it != entries_->end();
+ ++it) {
+ base::DictionaryValue* log_entry = NULL;
+ (*it)->GetAsDictionary(&log_entry);
+ if (log_entry != NULL) {
+ std::string level;
+ if (log_entry->GetString("level", &level)) {
+ if (level == kLevelToName[Log::kError]) {
+ std::string message;
+ if (log_entry->GetString("message", &message))
+ return message;
+ }
+ }
+ }
+ }
+ return std::string();
+}
+
void WebDriverLog::AddEntryTimestamped(const base::Time& timestamp,
Log::Level level,
const std::string& source,
« no previous file with comments | « chrome/test/chromedriver/logging.h ('k') | chrome/test/chromedriver/logging_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698