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

Unified Diff: chrome/test/chromedriver/logging.cc

Issue 14263024: Logging API in chromedriver2. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/logging.cc
===================================================================
--- chrome/test/chromedriver/logging.cc (revision 0)
+++ chrome/test/chromedriver/logging.cc (revision 0)
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/chromedriver/logging.h"
+
+#include "chrome/test/chromedriver/capabilities.h"
+#include "chrome/test/chromedriver/chrome/devtools_event_logger.h"
+#include "chrome/test/chromedriver/chrome/status.h"
+
+
kkania 2013/04/18 20:27:55 remove newline
klm 2013/04/18 22:53:34 Done.
+Status CreateLoggers(const Capabilities& capabilities,
+ ScopedVector<DevToolsEventLogger>* out_loggers) {
+ ScopedVector<DevToolsEventLogger> loggers;
+ for (DictionaryValue::Iterator pref(*capabilities.logging_prefs);
+ !pref.IsAtEnd(); pref.Advance()) {
+ const std::string type = pref.key();
+ std::string level;
+ if (!pref.value().GetAsString(&level)) {
+ return Status(kUnknownError,
+ "logging level must be a string for log type: " + type);
+ }
+ if ("performance" == type) {
kkania 2013/04/18 20:27:55 i notice the java client has a "profiling" type; d
klm 2013/04/18 22:53:34 Done. Meant to look that up and never did, thanks:
+ std::vector<std::string> domains;
+ domains.push_back("Network");
+ domains.push_back("Page");
+ domains.push_back("Timeline");
+ loggers.push_back(new DevToolsEventLogger(type, domains, level));
+ } else {
+ return Status(kUnknownError, "unsupported log type: " + type);
+ }
+ // TODO(klm): Implement and add here the console logger.
+ }
+ out_loggers->swap(loggers);
+ return Status(kOk);
+}

Powered by Google App Engine
This is Rietveld 408576698