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

Unified Diff: chrome/test/chromedriver/logging_unittest.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.cc ('k') | chrome/test/chromedriver/server/http_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/logging_unittest.cc
diff --git a/chrome/test/chromedriver/logging_unittest.cc b/chrome/test/chromedriver/logging_unittest.cc
index 0520e8d4fc73cc2efeed5c9dd835c9992c86d9c3..7912b6360eff526784122fce4ed6cf0f74ec77cf 100644
--- a/chrome/test/chromedriver/logging_unittest.cc
+++ b/chrome/test/chromedriver/logging_unittest.cc
@@ -135,3 +135,19 @@ TEST(Logging, DefaultLogs) {
ASSERT_EQ(1u, listeners.size());
ASSERT_EQ("browser", logs[0]->type());
}
+
+TEST(Logging, GetFirstErrorMessage) {
+ WebDriverLog log(WebDriverLog::kBrowserType, Log::kAll);
+ std::string entry;
+
+ entry = log.GetFirstErrorMessage();
+ ASSERT_TRUE(entry.empty());
+
+ log.AddEntry(Log::kInfo, "info message");
+ log.AddEntry(Log::kError, "first error message");
+ log.AddEntry(Log::kDebug, "debug message");
+ log.AddEntry(Log::kError, "second error message");
+
+ entry = log.GetFirstErrorMessage();
+ ASSERT_EQ("first error message", entry);
+}
« no previous file with comments | « chrome/test/chromedriver/logging.cc ('k') | chrome/test/chromedriver/server/http_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698