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

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

Issue 2485843002: [chromecast] Merge ChromecastBrowserTestHelper into ChromecastBrowserTest (Closed)
Patch Set: addressed comment Created 4 years, 1 month 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_helper_default.cc
diff --git a/chromecast/browser/test/chromecast_browser_test_helper_default.cc b/chromecast/browser/test/chromecast_browser_test_helper_default.cc
deleted file mode 100644
index d80eeeacf6869e86951dddc1182d135dcecb3ea7..0000000000000000000000000000000000000000
--- a/chromecast/browser/test/chromecast_browser_test_helper_default.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chromecast/browser/test/chromecast_browser_test_helper.h"
-
-#include "base/memory/ptr_util.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/cast_media_blocker.h"
-#include "content/public/browser/media_session.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 {
-namespace {
-
-class DefaultHelper : public ChromecastBrowserTestHelper {
- public:
- ~DefaultHelper() override {}
-
- content::WebContents* NavigateToURL(const GURL& url) override {
- window_.reset(new CastContentWindow);
-
- web_contents_ = window_->CreateWebContents(
- CastBrowserProcess::GetInstance()->browser_context());
- window_->CreateWindowTree(web_contents_.get());
- blocker_.reset(new CastMediaBlocker(
- content::MediaSession::Get(web_contents_.get()), web_contents_.get()));
-
- content::WaitForLoadStop(web_contents_.get());
- 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();
- }
-
- void BlockMediaLoading(bool block) override {
- blocker_->BlockMediaLoading(block);
- }
-
- private:
- std::unique_ptr<CastContentWindow> window_;
- std::unique_ptr<content::WebContents> web_contents_;
- std::unique_ptr<CastMediaBlocker> blocker_;
-};
-
-} // namespace
-
-std::unique_ptr<ChromecastBrowserTestHelper>
-ChromecastBrowserTestHelper::Create() {
- return base::MakeUnique<DefaultHelper>();
-}
-
-} // namespace shell
-} // namespace chromecast
« no previous file with comments | « chromecast/browser/test/chromecast_browser_test_helper.h ('k') | chromecast/browser/test/chromecast_shell_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698