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

Unified Diff: content/shell/browser/layout_test/devtools_protocol_test_bindings.h

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: Protocol -> dp Created 3 years, 6 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: content/shell/browser/layout_test/devtools_protocol_test_bindings.h
diff --git a/content/shell/browser/layout_test/devtools_protocol_test_bindings.h b/content/shell/browser/layout_test/devtools_protocol_test_bindings.h
new file mode 100644
index 0000000000000000000000000000000000000000..4cdb0b237db33b90eccd4094c4f9217ac1cd6de7
--- /dev/null
+++ b/content/shell/browser/layout_test/devtools_protocol_test_bindings.h
@@ -0,0 +1,49 @@
+// 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 CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_
+#define CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_
+
+#include <memory>
+#include <string>
+
+#include "content/public/browser/devtools_agent_host_client.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "url/gurl.h"
+
+namespace content {
+
+class DevToolsAgentHost;
+class DevToolsFrontendHost;
+
+class DevToolsProtocolTestBindings : public WebContentsObserver,
+ public DevToolsAgentHostClient {
+ public:
+ explicit DevToolsProtocolTestBindings(WebContents* devtools);
+ ~DevToolsProtocolTestBindings() override;
+ static GURL GetProtocolTestURL(const GURL& test_url);
+
+ private:
+ // content::DevToolsAgentHostClient implementation.
+ void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override;
+ void DispatchProtocolMessage(DevToolsAgentHost* agent_host,
+ const std::string& message) override;
+
+ // WebContentsObserver overrides
+ void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override;
+ void WebContentsDestroyed() override;
+
+ void HandleMessageFromTest(const std::string& message);
+
+ scoped_refptr<DevToolsAgentHost> agent_host_;
+#if !defined(OS_ANDROID)
+ std::unique_ptr<DevToolsFrontendHost> frontend_host_;
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolTestBindings);
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_

Powered by Google App Engine
This is Rietveld 408576698