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

Unified Diff: chrome/test/chromedriver/devtools_events_logger.h

Issue 2743013002: Add webdriver endpoint to send custom debugger commands (Closed)
Patch Set: Adding stub, quick code reorg Created 3 years, 7 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/devtools_events_logger.h
diff --git a/chrome/test/chromedriver/devtools_events_logger.h b/chrome/test/chromedriver/devtools_events_logger.h
new file mode 100644
index 0000000000000000000000000000000000000000..570e7e56e2ccf35c0023cda42db5ee2a62953d2a
--- /dev/null
+++ b/chrome/test/chromedriver/devtools_events_logger.h
@@ -0,0 +1,47 @@
+// Copyright 2017 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.
+
+#ifndef CHROME_TEST_CHROMEDRIVER_DEVTOOLS_EVENTS_LOGGER_H_
+#define CHROME_TEST_CHROMEDRIVER_DEVTOOLS_EVENTS_LOGGER_H_
+
+#include <string>
+#include <unordered_set>
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/values.h"
+#include "chrome/test/chromedriver/chrome/devtools_event_listener.h"
+#include "chrome/test/chromedriver/chrome/log.h"
+#include "chrome/test/chromedriver/chrome/status.h"
+
+// Collects DevTools events into Log messages with info level.
+//
+// The message is a JSON string of the following structure:
+// {
+// "message": { "method": "...", "params": { ... }} // DevTools message.
+// }
+
+class DevToolsEventsLogger : public DevToolsEventListener {
+ public:
+ // Creates a |DevToolsEventsLogger| with specific preferences.
+ DevToolsEventsLogger(Log* log, const base::ListValue* prefs);
+
+ ~DevToolsEventsLogger() override;
+
+ Status OnConnected(DevToolsClient* client) override;
+
+ Status OnEvent(DevToolsClient* client,
+ const std::string& method,
+ const base::DictionaryValue& params) override;
+
+ private:
+ Log* log_; // The log where to create entries.
+
+ const base::ListValue* prefs_;
+ std::unordered_set<std::string> events_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsEventsLogger);
+};
+
+#endif // CHROME_TEST_CHROMEDRIVER_DEVTOOLS_EVENTS_LOGGER_H_
« no previous file with comments | « chrome/test/chromedriver/client/command_executor.py ('k') | chrome/test/chromedriver/devtools_events_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698