Commit 6e5b06e0 authored by avayvod's avatar avayvod Committed by Commit bot

[Cast, Tests] Handle low end and JB devices that don't preload videos

BUG=652872,652389
TEST=run_chrome_public_test_apk --verbose --gtest_filter=org.chromium.chrome.browser.media.remote.* on both low end and not a low end device.

Since https://codereview.chromium.org/2344353003 on low-end and JB devices videos
are not preloaded so we have to trigger that in a button onclick handler.

Review-Url: https://codereview.chromium.org/2400543002
Cr-Commit-Position: refs/heads/master@{#423775}
parent 65b61482
......@@ -159,6 +159,7 @@ public class CastSwitchVideoTest extends CastTestBase {
TimeoutException {
final Tab tab = getActivity().getActivityTab();
WebContents webContents = tab.getWebContents();
DOMUtils.clickNode(this, tab.getContentViewCore(), "button1");
waitUntilVideoReady(videoElement, webContents);
Rect videoRect = DOMUtils.getNodeBounds(webContents, videoElement);
......@@ -170,6 +171,7 @@ public class CastSwitchVideoTest extends CastTestBase {
final Tab tab = getActivity().getActivityTab();
WebContents webContents = tab.getWebContents();
DOMUtils.clickNode(this, tab.getContentViewCore(), "button1");
waitUntilVideoReady(videoElement, webContents);
// Need to click on the video first to overcome the user gesture requirement.
......
......@@ -262,6 +262,7 @@ public abstract class CastTestBase extends ChromeActivityTestCaseBase<ChromeActi
WebContents webContents = currentTab.getWebContents();
DOMUtils.clickNode(this, currentTab.getContentViewCore(), "button1");
waitUntilVideoReady(VIDEO_ELEMENT, webContents);
return DOMUtils.getNodeBounds(webContents, VIDEO_ELEMENT);
......
......@@ -4,5 +4,12 @@
<!-- Width should be large enough to dispaly all media controls without needing
an overflow menu. -->
<video src="test.webm" controls id="video" width=500></video>
<script>
function loadvideo() {
var video = document.getElementById('video');
video.load();
}
</script>
<button id="button1" onclick="loadvideo()">Click me</button>
</body>
</html>
......@@ -2,5 +2,12 @@
<title>test</title>
<body bgcolor="Silver">
<video src="test2.webm" controls id="video"></video>
<script>
function loadvideo() {
var video = document.getElementById('video');
video.load();
}
</script>
<button id="button1" onclick="loadvideo()">Click me</button>
</body>
</html>
......@@ -3,5 +3,14 @@
<body bgcolor="Silver">
<video src="test.webm" controls id="video"></video>
<video src="test2.webm" controls id="video2"></video>
<script>
function loadvideos() {
var video = document.getElementById('video');
var video2 = document.getElementById('video2');
video.load();
video2.load();
}
</script>
<button id="button1" onclick="loadvideos()">Click me</button>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment