Chromium Code Reviews| 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, |