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

Unified Diff: content/test/test_renderer_host.cc

Issue 9706012: Add abstractions that let embedders drive tests of WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove CONTENT_EXPORT on statically linked functions. Merge to head for commit. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/test_renderer_host.h ('k') | content/test/web_contents_tester.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_renderer_host.cc
diff --git a/content/test/test_renderer_host.cc b/content/test/test_renderer_host.cc
index 1f578f678cd57dfd5e21a3ae7e9d02d38f976382..cb03104b46f53ed59747ea8b593f8bd9a36b6843 100644
--- a/content/test/test_renderer_host.cc
+++ b/content/test/test_renderer_host.cc
@@ -9,6 +9,7 @@
#include "content/browser/site_instance_impl.h"
#include "content/browser/tab_contents/navigation_entry_impl.h"
#include "content/browser/tab_contents/test_tab_contents.h"
+#include "content/public/browser/web_contents.h"
#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_context.h"
@@ -122,19 +123,20 @@ RenderViewHostTestHarness::~RenderViewHostTestHarness() {
}
NavigationController& RenderViewHostTestHarness::controller() {
- return contents()->GetController();
+ return web_contents()->GetController();
}
-TestTabContents* RenderViewHostTestHarness::contents() {
+WebContents* RenderViewHostTestHarness::web_contents() {
return contents_.get();
}
RenderViewHost* RenderViewHostTestHarness::rvh() {
- return contents()->GetRenderViewHost();
+ return web_contents()->GetRenderViewHost();
}
RenderViewHost* RenderViewHostTestHarness::pending_rvh() {
- return contents()->GetRenderManagerForTesting()->pending_render_view_host();
+ return static_cast<TestTabContents*>(web_contents())->
+ GetRenderManagerForTesting()->pending_render_view_host();
}
RenderViewHost* RenderViewHostTestHarness::active_rvh() {
@@ -153,11 +155,11 @@ void RenderViewHostTestHarness::DeleteContents() {
SetContents(NULL);
}
-void RenderViewHostTestHarness::SetContents(TestTabContents* contents) {
+void RenderViewHostTestHarness::SetContents(WebContents* contents) {
contents_.reset(contents);
}
-TestTabContents* RenderViewHostTestHarness::CreateTestTabContents() {
+WebContents* RenderViewHostTestHarness::CreateTestWebContents() {
// See comment above browser_context_ decl for why we check for NULL here.
if (!browser_context_.get())
browser_context_.reset(new TestBrowserContext());
@@ -169,7 +171,7 @@ TestTabContents* RenderViewHostTestHarness::CreateTestTabContents() {
}
void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) {
- contents()->NavigateAndCommit(url);
+ static_cast<TestTabContents*>(web_contents())->NavigateAndCommit(url);
}
void RenderViewHostTestHarness::Reload() {
@@ -187,7 +189,7 @@ void RenderViewHostTestHarness::SetUp() {
test_stacking_client_.reset(
new aura::test::TestStackingClient(root_window_.get()));
#endif
- SetContents(CreateTestTabContents());
+ SetContents(CreateTestWebContents());
}
void RenderViewHostTestHarness::TearDown() {
« no previous file with comments | « content/test/test_renderer_host.h ('k') | content/test/web_contents_tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698