| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_DEVTOOLS_BINDINGS_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_DEVTOOLS_BINDINGS_H_ |
| 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_DEVTOOLS_BINDINGS_H_ | 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_DEVTOOLS_BINDINGS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "content/shell/browser/shell_devtools_frontend.h" | 10 #include "content/shell/browser/shell_devtools_frontend.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 class WebContents; | 14 class WebContents; |
| 15 | 15 |
| 16 class LayoutTestDevToolsBindings : public ShellDevToolsBindings { | 16 class LayoutTestDevToolsBindings : public ShellDevToolsBindings { |
| 17 public: | 17 public: |
| 18 static GURL GetDevToolsPathAsURL(const std::string& frontend_url); | 18 static GURL GetDevToolsPathAsURL(const std::string& frontend_url); |
| 19 | 19 |
| 20 static GURL MapJSTestURL(const GURL& test_url); | 20 static GURL MapTestURLIfNeeded(const GURL& test_url, |
| 21 bool* is_integration_test); |
| 21 | 22 |
| 22 static LayoutTestDevToolsBindings* LoadDevTools( | 23 static LayoutTestDevToolsBindings* LoadDevTools( |
| 23 WebContents* devtools_contents_, | 24 WebContents* devtools_contents_, |
| 24 WebContents* inspected_contents_, | 25 WebContents* inspected_contents_, |
| 25 const std::string& settings, | 26 const std::string& settings, |
| 26 const std::string& frontend_url); | 27 const std::string& frontend_url); |
| 27 void EvaluateInFrontend(int call_id, const std::string& expression); | 28 void EvaluateInFrontend(int call_id, const std::string& expression); |
| 28 | 29 |
| 29 ~LayoutTestDevToolsBindings() override; | 30 ~LayoutTestDevToolsBindings() override; |
| 30 | 31 |
| 31 private: | 32 private: |
| 33 static GURL MapJSTestURL(const GURL& test_url, |
| 34 const std::string& entry_filename); |
| 35 |
| 32 LayoutTestDevToolsBindings(WebContents* devtools_contents, | 36 LayoutTestDevToolsBindings(WebContents* devtools_contents, |
| 33 WebContents* inspected_contents); | 37 WebContents* inspected_contents); |
| 34 | 38 |
| 35 // ShellDevToolsBindings overrides. | 39 // ShellDevToolsBindings overrides. |
| 36 void HandleMessageFromDevToolsFrontend(const std::string& message) override; | 40 void HandleMessageFromDevToolsFrontend(const std::string& message) override; |
| 37 | 41 |
| 38 // WebContentsObserver implementation. | 42 // WebContentsObserver implementation. |
| 39 void RenderProcessGone(base::TerminationStatus status) override; | 43 void RenderProcessGone(base::TerminationStatus status) override; |
| 40 void RenderFrameCreated(RenderFrameHost* render_frame_host) override; | 44 void RenderFrameCreated(RenderFrameHost* render_frame_host) override; |
| 41 | 45 |
| 42 bool ready_for_test_; | 46 bool ready_for_test_; |
| 43 std::vector<std::pair<int, std::string>> pending_evaluations_; | 47 std::vector<std::pair<int, std::string>> pending_evaluations_; |
| 44 | 48 |
| 45 DISALLOW_COPY_AND_ASSIGN(LayoutTestDevToolsBindings); | 49 DISALLOW_COPY_AND_ASSIGN(LayoutTestDevToolsBindings); |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 } // namespace content | 52 } // namespace content |
| 49 | 53 |
| 50 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_DEVTOOLS_BINDINGS_H_ | 54 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_DEVTOOLS_BINDINGS_H_ |
| OLD | NEW |