Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 | 89 |
| 90 // Simulates a navigation to |url| failing with the error code |error_code|. | 90 // Simulates a navigation to |url| failing with the error code |error_code|. |
| 91 virtual void SimulateNavigationError(const GURL& url, int error_code) = 0; | 91 virtual void SimulateNavigationError(const GURL& url, int error_code) = 0; |
| 92 | 92 |
| 93 // Simulates the commit of an error page following a navigation failure. | 93 // Simulates the commit of an error page following a navigation failure. |
| 94 virtual void SimulateNavigationErrorPageCommit() = 0; | 94 virtual void SimulateNavigationErrorPageCommit() = 0; |
| 95 | 95 |
| 96 // Simulates a navigation stopping in the RenderFrameHost. | 96 // Simulates a navigation stopping in the RenderFrameHost. |
| 97 virtual void SimulateNavigationStop() = 0; | 97 virtual void SimulateNavigationStop() = 0; |
| 98 | 98 |
| 99 // If we are doing a cross-site navigation, this simulates the current RFH | |
|
clamy
2016/08/30 23:08:38
nit: s/RFH/RenderFrameHost here and below.
scottmg
2016/08/30 23:55:30
Done.
| |
| 100 // notifying that it has unloaded so the pending RFH is resumed and can | |
| 101 // navigate. | |
| 102 // PlzNavigate: the pending RFH is not created before the navigation commit, | |
|
clamy
2016/08/30 23:08:38
This comment from "the pending RFH" to "deleted in
scottmg
2016/08/30 23:55:30
Done.
| |
| 103 // so it is necessary to simulate the IO thread response here to commit in the | |
| 104 // proper renderer. It is necessary to call PrepareForCommit before getting | |
| 105 // the main and the pending frame because when we are trying to navigate to a | |
| 106 // webui from a new tab, a RenderFrameHost is created to display it that is | |
| 107 // committed immediately (since it is a new tab). Therefore the main frame is | |
| 108 // replaced without a pending frame being created, and we don't get the right | |
| 109 // values for the RFH to navigate: we try to use the old one that has been | |
| 110 // deleted in the meantime. | |
| 111 // Note that for some synchronous navigations (about:blank, javascript | |
| 112 // urls, etc.) there will be no NavigationRequest, and no simulation of the | |
|
clamy
2016/08/30 23:08:38
Please remove the mention of NavigationRequest, si
scottmg
2016/08/30 23:55:30
Done.
| |
| 113 // network stack is required. | |
| 114 virtual void SimulateUnloading() = 0; | |
| 115 | |
| 99 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given | 116 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given |
| 100 // information with various sets of parameters. These are helper functions for | 117 // information with various sets of parameters. These are helper functions for |
| 101 // simulating the most common types of loads. | 118 // simulating the most common types of loads. |
| 102 // | 119 // |
| 103 // Guidance for calling these: | 120 // Guidance for calling these: |
| 104 // - nav_entry_id should be 0 if simulating a renderer-initiated navigation; | 121 // - nav_entry_id should be 0 if simulating a renderer-initiated navigation; |
| 105 // if simulating a browser-initiated one, pass the GetUniqueID() value of | 122 // if simulating a browser-initiated one, pass the GetUniqueID() value of |
| 106 // the NavigationController's PendingEntry. | 123 // the NavigationController's PendingEntry. |
| 107 // - did_create_new_entry should be true if simulating a navigation that | 124 // - did_create_new_entry should be true if simulating a navigation that |
| 108 // created a new navigation entry; false for history navigations, reloads, | 125 // created a new navigation entry; false for history navigations, reloads, |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 std::unique_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 299 std::unique_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
| 283 #endif | 300 #endif |
| 284 RenderViewHostTestEnabler rvh_test_enabler_; | 301 RenderViewHostTestEnabler rvh_test_enabler_; |
| 285 | 302 |
| 286 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 303 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
| 287 }; | 304 }; |
| 288 | 305 |
| 289 } // namespace content | 306 } // namespace content |
| 290 | 307 |
| 291 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 308 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| OLD | NEW |