| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/test/media_router/media_router_integration_browsertest.h" | 5 #include "chrome/test/media_router/media_router_integration_browsertest.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 void MediaRouterIntegrationBrowserTest::OpenTestPage( | 145 void MediaRouterIntegrationBrowserTest::OpenTestPage( |
| 146 base::FilePath::StringPieceType file_name) { | 146 base::FilePath::StringPieceType file_name) { |
| 147 base::FilePath full_path = GetResourceFile(file_name); | 147 base::FilePath full_path = GetResourceFile(file_name); |
| 148 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(full_path)); | 148 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(full_path)); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void MediaRouterIntegrationBrowserTest::OpenTestPageInNewTab( | 151 void MediaRouterIntegrationBrowserTest::OpenTestPageInNewTab( |
| 152 base::FilePath::StringPieceType file_name) { | 152 base::FilePath::StringPieceType file_name) { |
| 153 base::FilePath full_path = GetResourceFile(file_name); | 153 base::FilePath full_path = GetResourceFile(file_name); |
| 154 ui_test_utils::NavigateToURLWithDisposition( | 154 ui_test_utils::NavigateToURLWithDisposition( |
| 155 browser(), net::FilePathToFileURL(full_path), NEW_FOREGROUND_TAB, | 155 browser(), net::FilePathToFileURL(full_path), |
| 156 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 156 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 157 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 157 } | 158 } |
| 158 | 159 |
| 159 void MediaRouterIntegrationBrowserTest::StartSession( | 160 void MediaRouterIntegrationBrowserTest::StartSession( |
| 160 content::WebContents* web_contents) { | 161 content::WebContents* web_contents) { |
| 161 test_navigation_observer_.reset( | 162 test_navigation_observer_.reset( |
| 162 new content::TestNavigationObserver(web_contents, 1)); | 163 new content::TestNavigationObserver(web_contents, 1)); |
| 163 test_navigation_observer_->StartWatchingNewWebContents(); | 164 test_navigation_observer_->StartWatchingNewWebContents(); |
| 164 ExecuteJavaScriptAPI(web_contents, kStartSessionScript); | 165 ExecuteJavaScriptAPI(web_contents, kStartSessionScript); |
| 165 test_navigation_observer_->Wait(); | 166 test_navigation_observer_->Wait(); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 | 598 |
| 598 MediaRouterDialogControllerImpl* controller = | 599 MediaRouterDialogControllerImpl* controller = |
| 599 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents); | 600 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents); |
| 600 EXPECT_TRUE(controller->IsShowingMediaRouterDialog()); | 601 EXPECT_TRUE(controller->IsShowingMediaRouterDialog()); |
| 601 WaitUntilSinkDiscoveredOnUI(); | 602 WaitUntilSinkDiscoveredOnUI(); |
| 602 controller->HideMediaRouterDialog(); | 603 controller->HideMediaRouterDialog(); |
| 603 CheckStartFailed(web_contents, "NotFoundError", "No screens found."); | 604 CheckStartFailed(web_contents, "NotFoundError", "No screens found."); |
| 604 } | 605 } |
| 605 | 606 |
| 606 } // namespace media_router | 607 } // namespace media_router |
| OLD | NEW |