| 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 <list> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "chrome/test/chromedriver/chrome/log.h" | 15 #include "chrome/test/chromedriver/chrome/log.h" |
| 15 | 16 |
| 16 struct Capabilities; | 17 struct Capabilities; |
| 18 class CommandListener; |
| 17 class DevToolsEventListener; | 19 class DevToolsEventListener; |
| 18 class ListValue; | 20 class ListValue; |
| 19 class Status; | 21 class Status; |
| 20 | 22 |
| 21 // 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. |
| 22 // See https://code.google.com/p/selenium/wiki/Logging. | 24 // See https://code.google.com/p/selenium/wiki/Logging. |
| 23 class WebDriverLog : public Log { | 25 class WebDriverLog : public Log { |
| 24 public: | 26 public: |
| 25 static const char kBrowserType[]; | 27 static const char kBrowserType[]; |
| 26 static const char kDriverType[]; | 28 static const char kDriverType[]; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 57 const std::string type_; // WebDriver log type. | 59 const std::string type_; // WebDriver log type. |
| 58 Level min_level_; // Minimum level of entries to store. | 60 Level min_level_; // Minimum level of entries to store. |
| 59 scoped_ptr<base::ListValue> entries_; // Accumulated entries. | 61 scoped_ptr<base::ListValue> entries_; // Accumulated entries. |
| 60 | 62 |
| 61 DISALLOW_COPY_AND_ASSIGN(WebDriverLog); | 63 DISALLOW_COPY_AND_ASSIGN(WebDriverLog); |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 // Initializes logging system for ChromeDriver. Returns true on success. | 66 // Initializes logging system for ChromeDriver. Returns true on success. |
| 65 bool InitLogging(); | 67 bool InitLogging(); |
| 66 | 68 |
| 67 // Creates Log's and DevToolsEventListener's based on logging preferences. | 69 // Creates Log's, DevToolsEventListener's, and CommandListener's based on |
| 70 // logging preferences. |
| 68 Status CreateLogs(const Capabilities& capabilities, | 71 Status CreateLogs(const Capabilities& capabilities, |
| 69 ScopedVector<WebDriverLog>* out_logs, | 72 ScopedVector<WebDriverLog>* out_logs, |
| 70 ScopedVector<DevToolsEventListener>* out_listeners); | 73 ScopedVector<DevToolsEventListener>* out_devtools_listeners, |
| 74 std::list<CommandListener*>* out_command_listeners); |
| 71 | 75 |
| 72 #endif // CHROME_TEST_CHROMEDRIVER_LOGGING_H_ | 76 #endif // CHROME_TEST_CHROMEDRIVER_LOGGING_H_ |
| OLD | NEW |