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

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

Issue 2743013002: Add webdriver endpoint to send custom debugger commands (Closed)
Patch Set: New DevToolsEventsLogger Created 3 years, 9 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..e691ffd78529792082a240932feb859c0f965d0c
--- /dev/null
+++ b/chrome/test/chromedriver/devtools_events_logger.h
@@ -0,0 +1,45 @@
+// Copyright 2014 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 "chrome/test/chromedriver/base_logger.h"
+#include "chrome/test/chromedriver/chrome/devtools_event_listener.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:
+// {
+// "webview": <originating WebView ID>,
+// "message": { "method": "...", "params": { ... }} // DevTools message.
+// }
+
+class DevToolsEventsLogger : public BaseLogger, 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:
+ const base::ListValue* prefs_;
+ std::unordered_set<std::string> events_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsEventsLogger);
+};
+
+#endif // CHROME_TEST_CHROMEDRIVER_DEVTOOLS_EVENTS_LOGGER_H_

Powered by Google App Engine
This is Rietveld 408576698