| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TEST_TEST_RENDER_FRAME_HOST_H_ | 5 #ifndef CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_ |
| 6 #define CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_ | 6 #define CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 FrameTree* frame_tree, | 45 FrameTree* frame_tree, |
| 46 FrameTreeNode* frame_tree_node, | 46 FrameTreeNode* frame_tree_node, |
| 47 int32_t routing_id, | 47 int32_t routing_id, |
| 48 int32_t widget_routing_id, | 48 int32_t widget_routing_id, |
| 49 int flags); | 49 int flags); |
| 50 ~TestRenderFrameHost() override; | 50 ~TestRenderFrameHost() override; |
| 51 | 51 |
| 52 // RenderFrameHostImpl overrides (same values, but in Test*/Mock* types) | 52 // RenderFrameHostImpl overrides (same values, but in Test*/Mock* types) |
| 53 TestRenderViewHost* GetRenderViewHost() override; | 53 TestRenderViewHost* GetRenderViewHost() override; |
| 54 MockRenderProcessHost* GetProcess() override; | 54 MockRenderProcessHost* GetProcess() override; |
| 55 void AddMessageToConsole(ConsoleMessageLevel, |
| 56 const std::string& message) override; |
| 55 | 57 |
| 56 // RenderFrameHostTester implementation. | 58 // RenderFrameHostTester implementation. |
| 57 void InitializeRenderFrameIfNeeded() override; | 59 void InitializeRenderFrameIfNeeded() override; |
| 58 TestRenderFrameHost* AppendChild(const std::string& frame_name) override; | 60 TestRenderFrameHost* AppendChild(const std::string& frame_name) override; |
| 59 void Detach() override; | 61 void Detach() override; |
| 60 void SimulateNavigationStart(const GURL& url) override; | 62 void SimulateNavigationStart(const GURL& url) override; |
| 61 void SimulateRedirect(const GURL& new_url) override; | 63 void SimulateRedirect(const GURL& new_url) override; |
| 62 void SimulateNavigationCommit(const GURL& url) override; | 64 void SimulateNavigationCommit(const GURL& url) override; |
| 63 void SimulateNavigationError(const GURL& url, int error_code) override; | 65 void SimulateNavigationError(const GURL& url, int error_code) override; |
| 64 void SimulateNavigationErrorPageCommit() override; | 66 void SimulateNavigationErrorPageCommit() override; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 90 | 92 |
| 91 void SendNavigateWithModificationCallback( | 93 void SendNavigateWithModificationCallback( |
| 92 int page_id, | 94 int page_id, |
| 93 int nav_entry_id, | 95 int nav_entry_id, |
| 94 bool did_create_new_entry, | 96 bool did_create_new_entry, |
| 95 const GURL& url, | 97 const GURL& url, |
| 96 const ModificationCallback& callback); | 98 const ModificationCallback& callback); |
| 97 void SendNavigateWithParams( | 99 void SendNavigateWithParams( |
| 98 FrameHostMsg_DidCommitProvisionalLoad_Params* params); | 100 FrameHostMsg_DidCommitProvisionalLoad_Params* params); |
| 99 | 101 |
| 102 std::vector<std::string> GetConsoleMessages() const { |
| 103 return console_messages_; |
| 104 } |
| 105 |
| 100 // Simulate a renderer-initiated navigation up until commit. | 106 // Simulate a renderer-initiated navigation up until commit. |
| 101 void NavigateAndCommitRendererInitiated(int page_id, | 107 void NavigateAndCommitRendererInitiated(int page_id, |
| 102 bool did_create_new_entry, | 108 bool did_create_new_entry, |
| 103 const GURL& url); | 109 const GURL& url); |
| 104 | 110 |
| 105 // With the current navigation logic this method is a no-op. | 111 // With the current navigation logic this method is a no-op. |
| 106 // PlzNavigate: this method simulates receiving a BeginNavigation IPC. | 112 // PlzNavigate: this method simulates receiving a BeginNavigation IPC. |
| 107 void SendRendererInitiatedNavigationRequest(const GURL& url, | 113 void SendRendererInitiatedNavigationRequest(const GURL& url, |
| 108 bool has_user_gesture); | 114 bool has_user_gesture); |
| 109 | 115 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // Computes the page ID for a pending navigation in this RenderFrameHost; | 155 // Computes the page ID for a pending navigation in this RenderFrameHost; |
| 150 int32_t ComputeNextPageID(); | 156 int32_t ComputeNextPageID(); |
| 151 | 157 |
| 152 TestRenderFrameHostCreationObserver child_creation_observer_; | 158 TestRenderFrameHostCreationObserver child_creation_observer_; |
| 153 | 159 |
| 154 std::string contents_mime_type_; | 160 std::string contents_mime_type_; |
| 155 | 161 |
| 156 // See set_simulate_history_list_was_cleared() above. | 162 // See set_simulate_history_list_was_cleared() above. |
| 157 bool simulate_history_list_was_cleared_; | 163 bool simulate_history_list_was_cleared_; |
| 158 | 164 |
| 165 // See AddMessageToConsole() above. |
| 166 std::vector<std::string> console_messages_; |
| 167 |
| 159 DISALLOW_COPY_AND_ASSIGN(TestRenderFrameHost); | 168 DISALLOW_COPY_AND_ASSIGN(TestRenderFrameHost); |
| 160 }; | 169 }; |
| 161 | 170 |
| 162 } // namespace content | 171 } // namespace content |
| 163 | 172 |
| 164 #endif // CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_ | 173 #endif // CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_ |
| OLD | NEW |