| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ = CastContentWindow::Create(this); | 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_->ShowWebContents(web_contents_.get()); | |
| 68 content::WaitForLoadStop(web_contents_.get()); | 67 content::WaitForLoadStop(web_contents_.get()); |
| 69 | 68 |
| 70 content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1); | 69 content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1); |
| 71 content::NavigationController::LoadURLParams params(url); | 70 content::NavigationController::LoadURLParams params(url); |
| 72 params.transition_type = ui::PageTransitionFromInt( | 71 params.transition_type = ui::PageTransitionFromInt( |
| 73 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); | 72 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); |
| 74 web_contents_->GetController().LoadURLWithParams(params); | 73 web_contents_->GetController().LoadURLWithParams(params); |
| 75 same_tab_observer.Wait(); | 74 same_tab_observer.Wait(); |
| 76 | 75 |
| 77 return web_contents_.get(); | 76 return web_contents_.get(); |
| 78 } | 77 } |
| 79 | 78 |
| 80 void CastBrowserTest::OnWindowDestroyed() {} | 79 void CastBrowserTest::OnWindowDestroyed() {} |
| 81 | 80 |
| 82 void CastBrowserTest::OnKeyEvent(const ui::KeyEvent& key_event) {} | 81 void CastBrowserTest::OnKeyEvent(const ui::KeyEvent& key_event) {} |
| 83 | 82 |
| 84 } // namespace shell | 83 } // namespace shell |
| 85 } // namespace chromecast | 84 } // namespace chromecast |
| OLD | NEW |