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

Side by Side 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 unified diff | 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 »
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 "base/values.h" 5 #include "base/values.h"
6 #include "chrome/test/chromedriver/capabilities.h" 6 #include "chrome/test/chromedriver/capabilities.h"
7 #include "chrome/test/chromedriver/chrome/devtools_event_listener.h" 7 #include "chrome/test/chromedriver/chrome/devtools_event_listener.h"
8 #include "chrome/test/chromedriver/chrome/log.h" 8 #include "chrome/test/chromedriver/chrome/log.h"
9 #include "chrome/test/chromedriver/chrome/status.h" 9 #include "chrome/test/chromedriver/chrome/status.h"
10 #include "chrome/test/chromedriver/logging.h" 10 #include "chrome/test/chromedriver/logging.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 Capabilities capabilities; 128 Capabilities capabilities;
129 129
130 ScopedVector<DevToolsEventListener> listeners; 130 ScopedVector<DevToolsEventListener> listeners;
131 ScopedVector<WebDriverLog> logs; 131 ScopedVector<WebDriverLog> logs;
132 Status status = CreateLogs(capabilities, &logs, &listeners); 132 Status status = CreateLogs(capabilities, &logs, &listeners);
133 EXPECT_TRUE(status.IsOk()); 133 EXPECT_TRUE(status.IsOk());
134 ASSERT_EQ(1u, logs.size()); 134 ASSERT_EQ(1u, logs.size());
135 ASSERT_EQ(1u, listeners.size()); 135 ASSERT_EQ(1u, listeners.size());
136 ASSERT_EQ("browser", logs[0]->type()); 136 ASSERT_EQ("browser", logs[0]->type());
137 } 137 }
138
139 TEST(Logging, GetFirstErrorMessage) {
140 WebDriverLog log(WebDriverLog::kBrowserType, Log::kAll);
141 std::string entry;
142
143 entry = log.GetFirstErrorMessage();
144 ASSERT_TRUE(entry.empty());
145
146 log.AddEntry(Log::kInfo, "info message");
147 log.AddEntry(Log::kError, "first error message");
148 log.AddEntry(Log::kDebug, "debug message");
149 log.AddEntry(Log::kError, "second error message");
150
151 entry = log.GetFirstErrorMessage();
152 ASSERT_EQ("first error message", entry);
153 }
OLDNEW
« 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