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); |
+} |