OLD | NEW |
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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/test/chromedriver/chrome/log.h" | 14 #include "chrome/test/chromedriver/chrome/log.h" |
15 | 15 |
16 struct Capabilities; | 16 struct Capabilities; |
17 class CommandListener; | 17 class CommandListener; |
18 class DevToolsEventListener; | 18 class DevToolsEventListener; |
19 class ListValue; | 19 class ListValue; |
20 struct Session; | 20 struct Session; |
21 class Status; | 21 class Status; |
22 | 22 |
23 // Accumulates WebDriver Logging API entries of a given type and minimum level. | 23 // Accumulates WebDriver Logging API entries of a given type and minimum level. |
24 // See https://code.google.com/p/selenium/wiki/Logging. | 24 // See https://code.google.com/p/selenium/wiki/Logging. |
25 class WebDriverLog : public Log { | 25 class WebDriverLog : public Log { |
26 public: | 26 public: |
27 static const char kBrowserType[]; | 27 static const char kBrowserType[]; |
28 static const char kDriverType[]; | 28 static const char kDriverType[]; |
29 static const char kPerformanceType[]; | 29 static const char kPerformanceType[]; |
| 30 static const char kDevToolsType[]; |
30 | 31 |
31 // Converts WD wire protocol level name -> Level, false on bad name. | 32 // Converts WD wire protocol level name -> Level, false on bad name. |
32 static bool NameToLevel(const std::string& name, Level* out_level); | 33 static bool NameToLevel(const std::string& name, Level* out_level); |
33 | 34 |
34 // Creates a WebDriverLog with the given type and minimum level. | 35 // Creates a WebDriverLog with the given type and minimum level. |
35 WebDriverLog(const std::string& type, Level min_level); | 36 WebDriverLog(const std::string& type, Level min_level); |
36 ~WebDriverLog() override; | 37 ~WebDriverLog() override; |
37 | 38 |
38 // Returns entries accumulated so far, as a ListValue ready for serialization | 39 // Returns entries accumulated so far, as a ListValue ready for serialization |
39 // into the wire protocol response to the "/log" command. | 40 // into the wire protocol response to the "/log" command. |
(...skipping 28 matching lines...) Expand all Loading... |
68 | 69 |
69 // Creates |Log|s, |DevToolsEventListener|s, and |CommandListener|s based on | 70 // Creates |Log|s, |DevToolsEventListener|s, and |CommandListener|s based on |
70 // logging preferences. | 71 // logging preferences. |
71 Status CreateLogs(const Capabilities& capabilities, | 72 Status CreateLogs(const Capabilities& capabilities, |
72 const Session* session, | 73 const Session* session, |
73 ScopedVector<WebDriverLog>* out_logs, | 74 ScopedVector<WebDriverLog>* out_logs, |
74 ScopedVector<DevToolsEventListener>* out_devtools_listeners, | 75 ScopedVector<DevToolsEventListener>* out_devtools_listeners, |
75 ScopedVector<CommandListener>* out_command_listeners); | 76 ScopedVector<CommandListener>* out_command_listeners); |
76 | 77 |
77 #endif // CHROME_TEST_CHROMEDRIVER_LOGGING_H_ | 78 #endif // CHROME_TEST_CHROMEDRIVER_LOGGING_H_ |
OLD | NEW |