OLD | NEW |
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 Loading... |
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 |
OLD | NEW |