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

Unified Diff: chromecast/browser/test/cast_browser_test.cc

Issue 2626863006: [Chromecast] Add CastWebContents (Closed)
Patch Set: Long overdue rebase Created 3 years, 10 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
Index: chromecast/browser/test/cast_browser_test.cc
diff --git a/chromecast/browser/test/cast_browser_test.cc b/chromecast/browser/test/cast_browser_test.cc
index 79aac3693a1a847e3e24630d82486dd598824012..29a32feab9494c4d2ad01e13942673d0c99c3c37 100644
--- a/chromecast/browser/test/cast_browser_test.cc
+++ b/chromecast/browser/test/cast_browser_test.cc
@@ -34,8 +34,7 @@ void CastBrowserTest::SetUp() {
}
void CastBrowserTest::TearDownOnMainThread() {
- web_contents_.reset();
- window_.reset();
+ cast_web_view_.reset();
BrowserTestBase::TearDownOnMainThread();
}
@@ -60,22 +59,25 @@ void CastBrowserTest::RunTestOnMainThreadLoop() {
}
content::WebContents* CastBrowserTest::NavigateToURL(const GURL& url) {
- window_ = CastContentWindow::Create(this);
+ cast_web_view_ = base::WrapUnique(new CastWebView(
+ this, CastBrowserProcess::GetInstance()->browser_context(), nullptr,
+ false /*transparent*/));
- web_contents_ = window_->CreateWebContents(
- CastBrowserProcess::GetInstance()->browser_context());
- content::WaitForLoadStop(web_contents_.get());
+ content::WebContents* web_contents = cast_web_view_->web_contents();
+ content::WaitForLoadStop(web_contents);
+ content::TestNavigationObserver same_tab_observer(web_contents, 1);
+
+ cast_web_view_->LoadUrl(url);
- content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1);
- content::NavigationController::LoadURLParams params(url);
- params.transition_type = ui::PageTransitionFromInt(
- ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
- web_contents_->GetController().LoadURLWithParams(params);
same_tab_observer.Wait();
- return web_contents_.get();
+ return web_contents;
}
+void CastBrowserTest::OnPageStopped(int reason) {}
+
+void CastBrowserTest::OnLoadingStateChanged(bool loading) {}
+
void CastBrowserTest::OnWindowDestroyed() {}
void CastBrowserTest::OnKeyEvent(const ui::KeyEvent& key_event) {}

Powered by Google App Engine
This is Rietveld 408576698