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

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

Issue 2653493007: Change the flow for UI mirroring tests to start mirroing first then play the video. Replace WaitUnt… (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | 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_e2e_ui_browsertest.cc
diff --git a/chrome/test/media_router/media_router_e2e_ui_browsertest.cc b/chrome/test/media_router/media_router_e2e_ui_browsertest.cc
index b689266a361777faef61dddd67f63670762dc48c..463d6bc46d43b0ec90008b9edca4e86cacfda1e9 100644
--- a/chrome/test/media_router/media_router_e2e_ui_browsertest.cc
+++ b/chrome/test/media_router/media_router_e2e_ui_browsertest.cc
@@ -11,36 +11,40 @@
namespace media_router {
IN_PROC_BROWSER_TEST_F(MediaRouterE2EBrowserTest, MANUAL_MirrorHTML5Video) {
- OpenMediaPage();
content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
+ browser()->tab_strip_model()->GetActiveWebContents();
- // Play the video on loop.
- std::string script = "document.getElementsByTagName('video')[0].loop=true;";
- ExecuteScript(web_contents, script);
- // Wait for 5s to the video is playing smoothly.
- Wait(base::TimeDelta::FromSeconds(5));
content::WebContents* dialog_contents = OpenMRDialog(web_contents);
- // Wait for 10s to make sure the dialog finishes rendering.
- Wait(base::TimeDelta::FromSeconds(10));
ASSERT_TRUE(dialog_contents);
+ // Wait for 2s to make sure the dialog finishes rendering.
imcheng 2017/01/24 20:03:31 nit: blank line before comments here and below.
cliffordcheng1 2017/01/24 23:13:18 Done.
+ Wait(base::TimeDelta::FromSeconds(2));
imcheng 2017/01/24 20:03:31 Can you use WaitUntilDialogFullyLoaded() here and
cliffordcheng1 2017/01/24 23:13:18 Done.
WaitUntilSinkDiscoveredOnUI();
ChooseSink(web_contents, receiver());
- WaitUntilRouteCreated();
-
// Mirror tab for 10s.
Wait(base::TimeDelta::FromSeconds(10));
+ OpenMRDialog(web_contents);
+ // Wait for 2s to make sure the dialog finishes rendering.
+ Wait(base::TimeDelta::FromSeconds(2));
+ // Check the mirroring session has started successfully.
+ ASSERT_TRUE(!GetRouteId(receiver()).empty());
+
+ OpenMediaPage();
+ // Play the video on loop.
+ std::string script = "document.getElementsByTagName('video')[0].loop=true;";
+ ExecuteScript(web_contents, script);
+ // Wait for 5s to the video is playing smoothly.
+ Wait(base::TimeDelta::FromSeconds(5));
// Go to full screen.
script = "document.getElementsByTagName('video')[0]."
"webkitRequestFullScreen();";
ExecuteScript(web_contents, script);
// Wait for 5s to the video is playing smoothly in full screen.
Wait(base::TimeDelta::FromSeconds(5));
- OpenMRDialog(web_contents);
- // Wait for 5s to make sure the dialog finishes rendering.
- Wait(base::TimeDelta::FromSeconds(5));
+ OpenMRDialog(web_contents);
+ // Wait for 2s to make sure the dialog finishes rendering.
+ Wait(base::TimeDelta::FromSeconds(2));
// Check the mirroring session is still live.
ASSERT_TRUE(!GetRouteId(receiver()).empty());
Wait(base::TimeDelta::FromSeconds(20));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698