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

Unified Diff: chrome/test/media_router/media_router_integration_browsertest.cc

Issue 2918433002: [Media Router tests] Fix MANUAL_Fail_StartCancelledNoSupportedSinks. (Closed)
Patch Set: Update comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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..d3d7ecf1c20294b3b97cfd316cba7e19eb07ad9e 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 for any sinks to be displayed.
+ 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() {

Powered by Google App Engine
This is Rietveld 408576698