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

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

Issue 2570623003: [Chromecast] Turn CastContentWindow into an abstract interface. (Closed)
Patch Set: Fix browser test Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « chromecast/browser/test/cast_browser_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 base::RunLoop().RunUntilIdle(); 53 base::RunLoop().RunUntilIdle();
54 54
55 metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting(); 55 metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting();
56 56
57 SetUpOnMainThread(); 57 SetUpOnMainThread();
58 RunTestOnMainThread(); 58 RunTestOnMainThread();
59 TearDownOnMainThread(); 59 TearDownOnMainThread();
60 } 60 }
61 61
62 content::WebContents* CastBrowserTest::NavigateToURL(const GURL& url) { 62 content::WebContents* CastBrowserTest::NavigateToURL(const GURL& url) {
63 window_ = base::MakeUnique<CastContentWindow>(); 63 window_ = CastContentWindow::Create(this);
64 64
65 web_contents_ = window_->CreateWebContents( 65 web_contents_ = window_->CreateWebContents(
66 CastBrowserProcess::GetInstance()->browser_context()); 66 CastBrowserProcess::GetInstance()->browser_context());
67 window_->CreateWindowTree(web_contents_.get()); 67 window_->ShowWebContents(web_contents_.get());
68 content::WaitForLoadStop(web_contents_.get()); 68 content::WaitForLoadStop(web_contents_.get());
69 69
70 content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1); 70 content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1);
71 content::NavigationController::LoadURLParams params(url); 71 content::NavigationController::LoadURLParams params(url);
72 params.transition_type = ui::PageTransitionFromInt( 72 params.transition_type = ui::PageTransitionFromInt(
73 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); 73 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
74 web_contents_->GetController().LoadURLWithParams(params); 74 web_contents_->GetController().LoadURLWithParams(params);
75 same_tab_observer.Wait(); 75 same_tab_observer.Wait();
76 76
77 return web_contents_.get(); 77 return web_contents_.get();
78 } 78 }
79 79
80 void CastBrowserTest::OnWindowDestroyed() {}
81
82 void CastBrowserTest::OnKeyEvent(const ui::KeyEvent& key_event) {}
83
80 } // namespace shell 84 } // namespace shell
81 } // namespace chromecast 85 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/test/cast_browser_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698