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

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: 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
Index: chrome/test/chromedriver/logging.cc
diff --git a/chrome/test/chromedriver/logging.cc b/chrome/test/chromedriver/logging.cc
index 5933f2a8c202cb85786bedfba5fb728b3444017e..2142183bfde9c11bc83d1e70f2f099867564a690 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 {
chrisgao (Use stgao instead) 2014/01/09 22:11:55 How do you handle error messages resulted from the
samuong 2014/01/16 00:29:28 In this case the error from navigation1 will get a
+ 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.compare(kLevelToName[Log::kError]) == 0) {
chrisgao (Use stgao instead) 2014/01/09 22:11:55 level == kLevelToName[Log::kError] ?
samuong 2014/01/16 00:29:28 Done. Obviously I'm still working on kicking the J
+ std::string message;
+ if (log_entry->GetString("message", &message))
+ return message;
chrisgao (Use stgao instead) 2014/01/09 22:11:55 If we do not clear the error message from the list
samuong 2014/01/16 00:29:28 When an error is auto-reported, I think most clien
+ }
+ }
+ }
+ }
+ return "";
chrisgao (Use stgao instead) 2014/01/09 22:11:55 "" -> std::string()
samuong 2014/01/16 00:29:28 Done.
+}
+
void WebDriverLog::AddEntryTimestamped(const base::Time& timestamp,
Log::Level level,
const std::string& source,

Powered by Google App Engine
This is Rietveld 408576698