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

Side by Side Diff: chrome/test/chromedriver/logging_unittest.cc

Issue 2655503002: Revert of [chromedriver] Prevent GetLog from returning more than 100,000 at a time. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « chrome/test/chromedriver/logging.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/test/chromedriver/capabilities.h" 9 #include "chrome/test/chromedriver/capabilities.h"
10 #include "chrome/test/chromedriver/chrome/devtools_event_listener.h" 10 #include "chrome/test/chromedriver/chrome/devtools_event_listener.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 ASSERT_TRUE(entry.empty()); 161 ASSERT_TRUE(entry.empty());
162 162
163 log.AddEntry(Log::kInfo, "info message"); 163 log.AddEntry(Log::kInfo, "info message");
164 log.AddEntry(Log::kError, "first error message"); 164 log.AddEntry(Log::kError, "first error message");
165 log.AddEntry(Log::kDebug, "debug message"); 165 log.AddEntry(Log::kDebug, "debug message");
166 log.AddEntry(Log::kError, "second error message"); 166 log.AddEntry(Log::kError, "second error message");
167 167
168 entry = log.GetFirstErrorMessage(); 168 entry = log.GetFirstErrorMessage();
169 ASSERT_EQ("first error message", entry); 169 ASSERT_EQ("first error message", entry);
170 } 170 }
171
172 TEST(Logging, GetLotsOfLogs) {
173 WebDriverLog log(WebDriverLog::kBrowserType, Log::kAll);
174 std::string entry;
175 for (size_t i = 0; i < WebDriverLog::kMaxReturnedEntries + 1; i++)
176 log.AddEntry(Log::kError, "info message");
177 std::unique_ptr<base::ListValue> entries = log.GetAndClearEntries();
178 ASSERT_EQ(WebDriverLog::kMaxReturnedEntries, entries->GetSize());
179 entries = log.GetAndClearEntries();
180 ASSERT_EQ(1u, entries->GetSize());
181 entries = log.GetAndClearEntries();
182 ASSERT_EQ(0u, entries->GetSize());
183 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/logging.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698