Commit ccd4ab46 authored by gunsch's avatar gunsch Committed by Commit bot

Chromecast browser test: use CastContentWindow for test lifetime.

R=lcwu@chromium.org,gusfernandez@chromium.org
BUG=None

Review URL: https://codereview.chromium.org/668933002

Cr-Commit-Position: refs/heads/master@{#300554}
parent 759a66d1
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "chromecast/browser/cast_browser_context.h" #include "chromecast/browser/cast_browser_context.h"
#include "chromecast/browser/cast_browser_process.h" #include "chromecast/browser/cast_browser_process.h"
#include "chromecast/browser/cast_content_window.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -51,6 +52,7 @@ void ChromecastBrowserTest::RunTestOnMainThreadLoop() { ...@@ -51,6 +52,7 @@ void ChromecastBrowserTest::RunTestOnMainThreadLoop() {
} }
web_contents_.reset(); web_contents_.reset();
window_.reset();
} }
void ChromecastBrowserTest::NavigateToURL(content::WebContents* window, void ChromecastBrowserTest::NavigateToURL(content::WebContents* window,
...@@ -66,12 +68,10 @@ void ChromecastBrowserTest::NavigateToURL(content::WebContents* window, ...@@ -66,12 +68,10 @@ void ChromecastBrowserTest::NavigateToURL(content::WebContents* window,
} }
content::WebContents* ChromecastBrowserTest::CreateBrowser() { content::WebContents* ChromecastBrowserTest::CreateBrowser() {
content::WebContents::CreateParams create_params( window_.reset(new CastContentWindow);
CastBrowserProcess::GetInstance()->browser_context(), gfx::Size initial_size(1280, 720);
NULL); web_contents_ = window_->Create(
create_params.routing_id = MSG_ROUTING_NONE; initial_size, CastBrowserProcess::GetInstance()->browser_context());
create_params.initial_size = gfx::Size(1280, 720);
web_contents_.reset(content::WebContents::Create(create_params));
return web_contents_.get(); return web_contents_.get();
} }
......
...@@ -15,6 +15,8 @@ class WebContents; ...@@ -15,6 +15,8 @@ class WebContents;
} }
namespace chromecast { namespace chromecast {
class CastContentWindow;
namespace shell { namespace shell {
// This test allows for running an entire browser-process lifecycle per unit // This test allows for running an entire browser-process lifecycle per unit
...@@ -44,6 +46,7 @@ class ChromecastBrowserTest : public content::BrowserTestBase { ...@@ -44,6 +46,7 @@ class ChromecastBrowserTest : public content::BrowserTestBase {
private: private:
scoped_ptr<content::WebContents> web_contents_; scoped_ptr<content::WebContents> web_contents_;
scoped_ptr<CastContentWindow> window_;
bool setup_called_; bool setup_called_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment