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

Side by Side Diff: chromecast/browser/test/cast_browser_test.cc

Issue 2570623003: [Chromecast] Turn CastContentWindow into an abstract interface. (Closed)
Patch Set: Set user data outside of contructor Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/browser/test/cast_browser_test.h" 5 #include "chromecast/browser/test/cast_browser_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chromecast/base/chromecast_switches.h" 10 #include "chromecast/base/chromecast_switches.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 base::RunLoop().RunUntilIdle(); 52 base::RunLoop().RunUntilIdle();
53 53
54 metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting(); 54 metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting();
55 55
56 SetUpOnMainThread(); 56 SetUpOnMainThread();
57 RunTestOnMainThread(); 57 RunTestOnMainThread();
58 TearDownOnMainThread(); 58 TearDownOnMainThread();
59 } 59 }
60 60
61 content::WebContents* CastBrowserTest::NavigateToURL(const GURL& url) { 61 content::WebContents* CastBrowserTest::NavigateToURL(const GURL& url) {
62 window_ = base::MakeUnique<CastContentWindow>(); 62 window_ = CastContentWindow::Create(this);
63 63
64 web_contents_ = window_->CreateWebContents( 64 web_contents_ = window_->CreateWebContents(
65 CastBrowserProcess::GetInstance()->browser_context()); 65 CastBrowserProcess::GetInstance()->browser_context());
66 window_->CreateWindowTree(web_contents_.get()); 66 window_->ShowWebContents(web_contents_.get());
67 content::WaitForLoadStop(web_contents_.get()); 67 content::WaitForLoadStop(web_contents_.get());
68 68
69 content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1); 69 content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1);
70 content::NavigationController::LoadURLParams params(url); 70 content::NavigationController::LoadURLParams params(url);
71 params.transition_type = ui::PageTransitionFromInt( 71 params.transition_type = ui::PageTransitionFromInt(
72 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); 72 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
73 web_contents_->GetController().LoadURLWithParams(params); 73 web_contents_->GetController().LoadURLWithParams(params);
74 same_tab_observer.Wait(); 74 same_tab_observer.Wait();
75 75
76 return web_contents_.get(); 76 return web_contents_.get();
77 } 77 }
78 78
79 void CastBrowserTest::OnWindowDestroyed() {
80 }
81
82 void CastBrowserTest::OnKeyDown(ui::KeyboardCode keycode) {
83 }
84
79 } // namespace shell 85 } // namespace shell
80 } // namespace chromecast 86 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698