Chromium Code Reviews| Index: chrome/test/media_router/media_router_integration_browsertest.cc |
| diff --git a/chrome/test/media_router/media_router_integration_browsertest.cc b/chrome/test/media_router/media_router_integration_browsertest.cc |
| index 78b2abf74ad4469ddc8438bd301d1ab86efd54e2..35e83856fb2e6941760a5d3c36a6fae433c2a213 100644 |
| --- a/chrome/test/media_router/media_router_integration_browsertest.cc |
| +++ b/chrome/test/media_router/media_router_integration_browsertest.cc |
| @@ -163,12 +163,16 @@ void MediaRouterIntegrationBrowserTest::ExecuteJavaScriptAPI( |
| ASSERT_TRUE(passed) << error_message; |
| } |
| -WebContents* MediaRouterIntegrationBrowserTest::StartSessionWithTestPageNow() { |
| +void MediaRouterIntegrationBrowserTest::StartSessionAndAssertNotFoundError() { |
| OpenTestPage(FILE_PATH_LITERAL("basic_test.html")); |
| WebContents* web_contents = GetActiveWebContents(); |
| CHECK(web_contents); |
| StartSession(web_contents); |
| - return web_contents; |
| + |
| + // Wait a bit for the UI to settle. |
|
mark a. foltz
2017/05/31 22:54:20
Maybe update this to "Wait for any sinks to be dis
imcheng
2017/05/31 23:12:27
Done.
|
| + Wait(base::TimeDelta::FromSeconds(1)); |
| + GetControllerForShownDialog(web_contents)->HideMediaRouterDialog(); |
| + CheckStartFailed(web_contents, "NotFoundError", "No screens found."); |
| } |
| WebContents* |
| @@ -628,18 +632,13 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, |
| IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, |
| MANUAL_Fail_StartCancelledNoSinks) { |
| SetTestData(FILE_PATH_LITERAL("no_sinks.json")); |
| - WebContents* web_contents = StartSessionWithTestPageNow(); |
| - GetControllerForShownDialog(web_contents)->HideMediaRouterDialog(); |
| - CheckStartFailed(web_contents, "NotFoundError", "No screens found."); |
| + StartSessionAndAssertNotFoundError(); |
| } |
| IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, |
| MANUAL_Fail_StartCancelledNoSupportedSinks) { |
| SetTestData(FILE_PATH_LITERAL("no_supported_sinks.json")); |
| - WebContents* web_contents = StartSessionWithTestPageNow(); |
| - WaitUntilSinkDiscoveredOnUI(); |
| - GetControllerForShownDialog(web_contents)->HideMediaRouterDialog(); |
| - CheckStartFailed(web_contents, "NotFoundError", "No screens found."); |
| + StartSessionAndAssertNotFoundError(); |
| } |
| void MediaRouterIntegrationIncognitoBrowserTest::InstallAndEnableMRExtension() { |