| Index: chrome/test/chromedriver/logging_unittest.cc
|
| diff --git a/chrome/test/chromedriver/logging_unittest.cc b/chrome/test/chromedriver/logging_unittest.cc
|
| index 47d0f470f0143da4331292e0b2fca27f56b0cedc..d0ef82b8af195d96a26861f51bf812c0dfbe0dbc 100644
|
| --- a/chrome/test/chromedriver/logging_unittest.cc
|
| +++ b/chrome/test/chromedriver/logging_unittest.cc
|
| @@ -168,3 +168,16 @@ TEST(Logging, GetFirstErrorMessage) {
|
| entry = log.GetFirstErrorMessage();
|
| ASSERT_EQ("first error message", entry);
|
| }
|
| +
|
| +TEST(Logging, GetLotsOfLogs) {
|
| + WebDriverLog log(WebDriverLog::kBrowserType, Log::kAll);
|
| + std::string entry;
|
| + for (size_t i = 0; i < WebDriverLog::kMaxReturnedEntries + 1; i++)
|
| + log.AddEntry(Log::kError, "info message");
|
| + std::unique_ptr<base::ListValue> entries = log.GetAndClearEntries();
|
| + ASSERT_EQ(WebDriverLog::kMaxReturnedEntries, entries->GetSize());
|
| + entries = log.GetAndClearEntries();
|
| + ASSERT_EQ(1u, entries->GetSize());
|
| + entries = log.GetAndClearEntries();
|
| + ASSERT_EQ(0u, entries->GetSize());
|
| +}
|
|
|