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

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

Issue 2918433002: [Media Router tests] Fix MANUAL_Fail_StartCancelledNoSupportedSinks. (Closed)
Patch Set: . 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
« no previous file with comments | « chrome/test/media_router/media_router_integration_browsertest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21:35:23 I think the logic to reject the start() promise in
imcheng 2017/05/31 21:49:02 The purpose of the Wait is to try to make sure tha
+ 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() {
« no previous file with comments | « chrome/test/media_router/media_router_integration_browsertest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698