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

Side by Side Diff: content/public/test/test_renderer_host.h

Issue 2682313002: Introduce NavigationSimulator to use in unit tests (Closed)
Patch Set: Addressed comments 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 unified diff | Download patch
« no previous file with comments | « content/public/test/navigation_simulator.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned 70 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned
71 // RenderFrameHost is owned by the parent RenderFrameHost. 71 // RenderFrameHost is owned by the parent RenderFrameHost.
72 virtual RenderFrameHost* AppendChild(const std::string& frame_name) = 0; 72 virtual RenderFrameHost* AppendChild(const std::string& frame_name) = 0;
73 73
74 // Gives tests access to RenderFrameHostImpl::OnDetach. Destroys |this|. 74 // Gives tests access to RenderFrameHostImpl::OnDetach. Destroys |this|.
75 virtual void Detach() = 0; 75 virtual void Detach() = 0;
76 76
77 // Simulates a renderer-initiated navigation to |url| starting in the 77 // Simulates a renderer-initiated navigation to |url| starting in the
78 // RenderFrameHost. 78 // RenderFrameHost.
79 // DEPRECATED: use NavigationSimulator instead.
79 virtual void SimulateNavigationStart(const GURL& url) = 0; 80 virtual void SimulateNavigationStart(const GURL& url) = 0;
80 81
81 // Simulates a redirect to |new_url| for the navigation in the 82 // Simulates a redirect to |new_url| for the navigation in the
82 // RenderFrameHost. 83 // RenderFrameHost.
84 // Note: this is deprecated for simulating renderer-initiated navigations. Use
85 // NavigationSimulator instead.
83 virtual void SimulateRedirect(const GURL& new_url) = 0; 86 virtual void SimulateRedirect(const GURL& new_url) = 0;
84 87
85 // Simulates a navigation to |url| committing in the RenderFrameHost. 88 // Simulates a navigation to |url| committing in the RenderFrameHost.
89 // Note: this is deprecated for simulating renderer-initiated navigations. Use
90 // NavigationSimulator instead.
86 virtual void SimulateNavigationCommit(const GURL& url) = 0; 91 virtual void SimulateNavigationCommit(const GURL& url) = 0;
87 92
88 // Simulates a navigation to |url| failing with the error code |error_code|. 93 // Simulates a navigation to |url| failing with the error code |error_code|.
94 // Note: this is deprecated for simulating renderer-initiated navigations. Use
95 // NavigationSimulator instead.
89 virtual void SimulateNavigationError(const GURL& url, int error_code) = 0; 96 virtual void SimulateNavigationError(const GURL& url, int error_code) = 0;
90 97
91 // Simulates the commit of an error page following a navigation failure. 98 // Simulates the commit of an error page following a navigation failure.
99 // Note: this is deprecated for simulating renderer-initiated navigations. Use
100 // NavigationSimulator instead.
92 virtual void SimulateNavigationErrorPageCommit() = 0; 101 virtual void SimulateNavigationErrorPageCommit() = 0;
93 102
94 // Simulates a navigation stopping in the RenderFrameHost. 103 // Simulates a navigation stopping in the RenderFrameHost.
95 virtual void SimulateNavigationStop() = 0; 104 virtual void SimulateNavigationStop() = 0;
96 105
97 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given 106 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given
98 // information with various sets of parameters. These are helper functions for 107 // information with various sets of parameters. These are helper functions for
99 // simulating the most common types of loads. 108 // simulating the most common types of loads.
100 // 109 //
101 // Guidance for calling these: 110 // Guidance for calling these:
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 #endif 293 #endif
285 std::unique_ptr<RenderViewHostTestEnabler> rvh_test_enabler_; 294 std::unique_ptr<RenderViewHostTestEnabler> rvh_test_enabler_;
286 RenderProcessHostFactory* factory_ = nullptr; 295 RenderProcessHostFactory* factory_ = nullptr;
287 296
288 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); 297 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness);
289 }; 298 };
290 299
291 } // namespace content 300 } // namespace content
292 301
293 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ 302 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_
OLDNEW
« no previous file with comments | « content/public/test/navigation_simulator.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698