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

Side by Side Diff: chrome/test/media_router/media_router_e2e_ui_browsertest.cc

Issue 2634213002: [Media Router] Add integration browser tests (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 unified diff | Download patch
OLDNEW
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_e2e_browsertest.h" 5 #include "chrome/test/media_router/media_router_e2e_browsertest.h"
6 6
7 #include "chrome/browser/ui/tabs/tab_strip_model.h" 7 #include "chrome/browser/ui/tabs/tab_strip_model.h"
8 #include "content/public/test/browser_test_utils.h" 8 #include "content/public/test/browser_test_utils.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace media_router { 11 namespace media_router {
12 12
13 IN_PROC_BROWSER_TEST_F(MediaRouterE2EBrowserTest, MANUAL_MirrorHTML5Video) { 13 IN_PROC_BROWSER_TEST_F(MediaRouterE2EBrowserTest, MANUAL_MirrorHTML5Video) {
14 OpenMediaPage(); 14 OpenMediaPage();
15 content::WebContents* web_contents = 15 content::WebContents* web_contents =
16 browser()->tab_strip_model()->GetActiveWebContents(); 16 browser()->tab_strip_model()->GetActiveWebContents();
17 17
18 // Play the video on loop. 18 // Play the video on loop.
19 std::string script = "document.getElementsByTagName('video')[0].loop=true;"; 19 std::string script = "document.getElementsByTagName('video')[0].loop=true;";
20 ExecuteScript(web_contents, script); 20 ExecuteScript(web_contents, script);
21 content::WebContents* dialog_contents = OpenMRDialog(web_contents); 21 content::WebContents* dialog_contents = OpenMRDialog(web_contents);
22 ASSERT_TRUE(dialog_contents); 22 ASSERT_TRUE(dialog_contents);
23 // Wait for 1s to make sure the dialog finishes rendering. 23 // Wait for 1s to make sure the dialog finishes rendering.
24 Wait(base::TimeDelta::FromSeconds(1)); 24 Wait(base::TimeDelta::FromSeconds(1));
25 WaitUntilSinkDiscoveredOnUI(); 25 WaitUntilSinkDiscoveredOnUI(web_contents);
26 ChooseSink(web_contents, receiver()); 26 ChooseSink(web_contents, receiver());
27 WaitUntilRouteCreated(); 27 WaitUntilRouteCreated();
28 28
29 // Mirror tab for 10s. 29 // Mirror tab for 10s.
30 Wait(base::TimeDelta::FromSeconds(10)); 30 Wait(base::TimeDelta::FromSeconds(10));
31 31
32 // Go to full screen. 32 // Go to full screen.
33 script = "document.getElementsByTagName('video')[0]." 33 script = "document.getElementsByTagName('video')[0]."
34 "webkitRequestFullScreen();"; 34 "webkitRequestFullScreen();";
35 ExecuteScript(web_contents, script); 35 ExecuteScript(web_contents, script);
36 OpenMRDialog(web_contents); 36 OpenMRDialog(web_contents);
37 37
38 // Check the mirroring session is still live. 38 // Check the mirroring session is still live.
39 ASSERT_TRUE(!GetRouteId(receiver()).empty()); 39 ASSERT_TRUE(!GetRouteId(receiver()).empty());
40 Wait(base::TimeDelta::FromSeconds(20)); 40 Wait(base::TimeDelta::FromSeconds(20));
41 CloseRouteOnUI(); 41 CloseRouteOnUI();
42 } 42 }
43 43
44 } // namespace media_router 44 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698