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

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

Issue 1870443003: [Chromecast] Enable browser media tests to work on internal builds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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/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
« no previous file with comments | « chromecast/browser/test/chromecast_browser_test.h ('k') | chromecast/browser/test/chromecast_browser_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698