| 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 #include "chrome/test/chromedriver/chrome/console_logger.h" | 5 #include "chrome/test/chromedriver/chrome/console_logger.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/macros.h" |
| 9 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 10 #include "base/values.h" | 13 #include "base/values.h" |
| 11 #include "chrome/test/chromedriver/chrome/devtools_client.h" | 14 #include "chrome/test/chromedriver/chrome/devtools_client.h" |
| 12 #include "chrome/test/chromedriver/chrome/log.h" | 15 #include "chrome/test/chromedriver/chrome/log.h" |
| 13 #include "chrome/test/chromedriver/chrome/status.h" | 16 #include "chrome/test/chromedriver/chrome/status.h" |
| 14 | 17 |
| 15 namespace { | 18 namespace { |
| 16 | 19 |
| 17 // Translates Console.messageAdded.message.level into Log::Level. | 20 // Translates Console.messageAdded.message.level into Log::Level. |
| 18 bool ConsoleLevelToLogLevel(const std::string& name, Log::Level *out_level) { | 21 bool ConsoleLevelToLogLevel(const std::string& name, Log::Level *out_level) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return Status(kOk); | 93 return Status(kOk); |
| 91 } | 94 } |
| 92 } | 95 } |
| 93 | 96 |
| 94 // Don't know how to format, log full JSON. | 97 // Don't know how to format, log full JSON. |
| 95 std::string message_json; | 98 std::string message_json; |
| 96 base::JSONWriter::Write(params, &message_json); | 99 base::JSONWriter::Write(params, &message_json); |
| 97 log_->AddEntry(Log::kWarning, message_json); | 100 log_->AddEntry(Log::kWarning, message_json); |
| 98 return Status(kOk); | 101 return Status(kOk); |
| 99 } | 102 } |
| OLD | NEW |