| Index: chromecast/browser/test/chromecast_browser_test.cc
|
| diff --git a/chromecast/browser/test/chromecast_browser_test.cc b/chromecast/browser/test/chromecast_browser_test.cc
|
| index 5dcf1ee34971dccec365b6672bd499e35fb89049..ac4c19f8da77cc6970f0b178276deaa81491c476 100644
|
| --- a/chromecast/browser/test/chromecast_browser_test.cc
|
| +++ b/chromecast/browser/test/chromecast_browser_test.cc
|
| @@ -6,16 +6,15 @@
|
|
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| -#include "base/message_loop/message_loop.h"
|
| +#include "base/run_loop.h"
|
| #include "chromecast/base/metrics/cast_metrics_helper.h"
|
| #include "chromecast/browser/cast_browser_context.h"
|
| #include "chromecast/browser/cast_browser_process.h"
|
| -#include "chromecast/browser/cast_content_window.h"
|
| +#include "chromecast/browser/test/chromecast_browser_test_helper.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/render_process_host.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/test/browser_test_utils.h"
|
| -#include "content/public/test/test_navigation_observer.h"
|
|
|
| namespace chromecast {
|
| namespace shell {
|
| @@ -40,40 +39,15 @@ void ChromecastBrowserTest::RunTestOnMainThreadLoop() {
|
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| base::RunLoop().RunUntilIdle();
|
|
|
| + helper_ = ChromecastBrowserTestHelper::Create();
|
| + metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting();
|
| SetUpOnMainThread();
|
|
|
| RunTestOnMainThread();
|
|
|
| TearDownOnMainThread();
|
|
|
| - web_contents_.reset();
|
| - window_.reset();
|
| -}
|
| -
|
| -void ChromecastBrowserTest::NavigateToURL(content::WebContents* window,
|
| - const GURL& url) {
|
| - content::WaitForLoadStop(window);
|
| - content::TestNavigationObserver same_tab_observer(window, 1);
|
| - content::NavigationController::LoadURLParams params(url);
|
| - params.transition_type = ui::PageTransitionFromInt(
|
| - ui::PAGE_TRANSITION_TYPED |
|
| - ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
|
| - window->GetController().LoadURLWithParams(params);
|
| - same_tab_observer.Wait();
|
| -}
|
| -
|
| -content::WebContents* ChromecastBrowserTest::CreateBrowser() {
|
| - window_.reset(new CastContentWindow);
|
| - gfx::Size initial_size(1280, 720);
|
| -
|
| - web_contents_ = window_->CreateWebContents(
|
| - initial_size,
|
| - CastBrowserProcess::GetInstance()->browser_context());
|
| - window_->CreateWindowTree(initial_size, web_contents_.get());
|
| -
|
| - metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting();
|
| -
|
| - return web_contents_.get();
|
| + helper_.reset();
|
| }
|
|
|
| } // namespace shell
|
|
|