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

Side by Side Diff: chrome/test/chromedriver/logging.h

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: 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
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 #ifndef CHROME_TEST_CHROMEDRIVER_LOGGING_H_ 5 #ifndef CHROME_TEST_CHROMEDRIVER_LOGGING_H_
6 #define CHROME_TEST_CHROMEDRIVER_LOGGING_H_ 6 #define CHROME_TEST_CHROMEDRIVER_LOGGING_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 21 matching lines...) Expand all
32 // Creates a WebDriverLog with the given type and minimum level. 32 // Creates a WebDriverLog with the given type and minimum level.
33 WebDriverLog(const std::string& type, Level min_level); 33 WebDriverLog(const std::string& type, Level min_level);
34 virtual ~WebDriverLog(); 34 virtual ~WebDriverLog();
35 35
36 // Returns entries accumulated so far, as a ListValue ready for serialization 36 // Returns entries accumulated so far, as a ListValue ready for serialization
37 // into the wire protocol response to the "/log" command. 37 // into the wire protocol response to the "/log" command.
38 // The caller assumes ownership of the ListValue, and the WebDriverLog 38 // The caller assumes ownership of the ListValue, and the WebDriverLog
39 // creates and owns a new empty ListValue for further accumulation. 39 // creates and owns a new empty ListValue for further accumulation.
40 scoped_ptr<base::ListValue> GetAndClearEntries(); 40 scoped_ptr<base::ListValue> GetAndClearEntries();
41 41
42 // Finds the first error message in the log and returns it. If none exist,
chrisgao (Use stgao instead) 2014/01/09 22:11:55 nit: exist -> exists ?
samuong 2014/01/16 00:29:28 I think it's "if none exist" or "if nothing exists
43 // returns an empty string. Does not clear entries.
44 std::string GetFirstErrorMessage() const;
chrisgao (Use stgao instead) 2014/01/09 22:11:55 What's the consideration behind only returning the
samuong 2014/01/16 00:29:28 The first error message gets returned to the clien
45
42 // Translates a Log entry level into a WebDriver level and stores the entry. 46 // Translates a Log entry level into a WebDriver level and stores the entry.
43 virtual void AddEntryTimestamped(const base::Time& timestamp, 47 virtual void AddEntryTimestamped(const base::Time& timestamp,
44 Level level, 48 Level level,
45 const std::string& source, 49 const std::string& source,
46 const std::string& message) OVERRIDE; 50 const std::string& message) OVERRIDE;
47 51
48 const std::string& type() const; 52 const std::string& type() const;
49 void set_min_level(Level min_level); 53 void set_min_level(Level min_level);
50 Level min_level() const; 54 Level min_level() const;
51 55
52 private: 56 private:
53 const std::string type_; // WebDriver log type. 57 const std::string type_; // WebDriver log type.
54 Level min_level_; // Minimum level of entries to store. 58 Level min_level_; // Minimum level of entries to store.
55 scoped_ptr<base::ListValue> entries_; // Accumulated entries. 59 scoped_ptr<base::ListValue> entries_; // Accumulated entries.
56 60
57 DISALLOW_COPY_AND_ASSIGN(WebDriverLog); 61 DISALLOW_COPY_AND_ASSIGN(WebDriverLog);
58 }; 62 };
59 63
60 // Initializes logging system for ChromeDriver. Returns true on success. 64 // Initializes logging system for ChromeDriver. Returns true on success.
61 bool InitLogging(); 65 bool InitLogging();
62 66
63 // Creates Log's and DevToolsEventListener's based on logging preferences. 67 // Creates Log's and DevToolsEventListener's based on logging preferences.
64 Status CreateLogs(const Capabilities& capabilities, 68 Status CreateLogs(const Capabilities& capabilities,
65 ScopedVector<WebDriverLog>* out_logs, 69 ScopedVector<WebDriverLog>* out_logs,
66 ScopedVector<DevToolsEventListener>* out_listeners); 70 ScopedVector<DevToolsEventListener>* out_listeners);
67 71
68 #endif // CHROME_TEST_CHROMEDRIVER_LOGGING_H_ 72 #endif // CHROME_TEST_CHROMEDRIVER_LOGGING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698