Commit c40111ec authored by Shakti Sahu's avatar Shakti Sahu Committed by Chromium LUCI CQ

Video IPH : Fixed color for night mode

This CL fixes IPH card rounded corner color for night mode. Also added
test for video player URL builder.

Bug: 1117148
Change-Id: Ia798a7122f6b992e758629d2d1d0830892090a79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2613933
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841341}
parent a01dde01
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
android:viewportHeight="10" android:viewportHeight="10"
android:autoMirrored="true"> android:autoMirrored="true">
<path <path
android:fillColor="@android:color/white" android:fillColor="@color/default_bg_color"
android:pathData="M 10,0 A 10,10 0 0 1 0,10 L 10,10 Z" /> android:pathData="M 10,0 A 10,10 0 0 1 0,10 L 10,10 Z" />
</vector> </vector>
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
android:viewportHeight="10" android:viewportHeight="10"
android:autoMirrored="true"> android:autoMirrored="true">
<path <path
android:fillColor="@android:color/white" android:fillColor="@color/default_bg_color"
android:pathData="M 0,0 A 10,10 0 0 0 10,10 L 0,10 Z" /> android:pathData="M 0,0 A 10,10 0 0 0 10,10 L 0,10 Z" />
</vector> </vector>
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
android:viewportHeight="10" android:viewportHeight="10"
android:autoMirrored="true"> android:autoMirrored="true">
<path <path
android:fillColor="@android:color/white" android:fillColor="@color/default_bg_color"
android:pathData="M 0,0 A 10,10 0 0 1 10,10 L 10,0 Z" /> android:pathData="M 0,0 A 10,10 0 0 1 10,10 L 10,0 Z" />
</vector> </vector>
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
android:viewportHeight="10" android:viewportHeight="10"
android:autoMirrored="true"> android:autoMirrored="true">
<path <path
android:fillColor="@android:color/white" android:fillColor="@color/default_bg_color"
android:pathData="M 0,10 A 10,10 0 0 1 10,0 L 0,0 Z" /> android:pathData="M 0,10 A 10,10 0 0 1 10,0 L 0,0 Z" />
</vector> </vector>
...@@ -78,7 +78,7 @@ public class TestVideoTutorialService implements VideoTutorialService { ...@@ -78,7 +78,7 @@ public class TestVideoTutorialService implements VideoTutorialService {
private void initializeTutorialList() { private void initializeTutorialList() {
mTutorials.add(new Tutorial(FeatureType.CHROME_INTRO, "Introduction to chrome", mTutorials.add(new Tutorial(FeatureType.CHROME_INTRO, "Introduction to chrome",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.mp4", "https://www.gstatic.com/chrome/video-tutorials/webm/1_Search_english.mp4",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png", "https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png",
"https://www.gstatic.com/chrome/video-tutorials/gif/sample_anim.gif", "https://www.gstatic.com/chrome/video-tutorials/gif/sample_anim.gif",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png", "https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png",
...@@ -86,7 +86,7 @@ public class TestVideoTutorialService implements VideoTutorialService { ...@@ -86,7 +86,7 @@ public class TestVideoTutorialService implements VideoTutorialService {
mTutorials.add(new Tutorial(FeatureType.DOWNLOAD, mTutorials.add(new Tutorial(FeatureType.DOWNLOAD,
"How to use Google Chrome's download functionality", "How to use Google Chrome's download functionality",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.mp4", "https://www.gstatic.com/chrome/video-tutorials/webm/1_Search_english.mp4",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png", "https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png",
"https://www.gstatic.com/chrome/video-tutorials/gif/sample_anim.gif", "https://www.gstatic.com/chrome/video-tutorials/gif/sample_anim.gif",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png", "https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png",
...@@ -94,7 +94,7 @@ public class TestVideoTutorialService implements VideoTutorialService { ...@@ -94,7 +94,7 @@ public class TestVideoTutorialService implements VideoTutorialService {
mTutorials.add(new Tutorial(FeatureType.SEARCH, mTutorials.add(new Tutorial(FeatureType.SEARCH,
"How to efficiently search with Google Chrome", "How to efficiently search with Google Chrome",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.mp4", "https://www.gstatic.com/chrome/video-tutorials/webm/1_Search_english.mp4",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png", "https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png",
"https://www.gstatic.com/chrome/video-tutorials/gif/sample_anim.gif", "https://www.gstatic.com/chrome/video-tutorials/gif/sample_anim.gif",
"https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png", "https://www.gstatic.com/chrome/video-tutorials/images/1_Search_english.png",
......
...@@ -78,7 +78,7 @@ public class VideoIPHCoordinatorImpl implements VideoIPHCoordinator { ...@@ -78,7 +78,7 @@ public class VideoIPHCoordinatorImpl implements VideoIPHCoordinator {
private void fetchImage( private void fetchImage(
Callback<Drawable> consumer, int widthPx, int heightPx, Tutorial tutorial) { Callback<Drawable> consumer, int widthPx, int heightPx, Tutorial tutorial) {
boolean useAnimatedGifUrl = ChromeFeatureList.getFieldTrialParamByFeatureAsBoolean( boolean useAnimatedGifUrl = ChromeFeatureList.getFieldTrialParamByFeatureAsBoolean(
ChromeFeatureList.VIDEO_TUTORIALS, VARIATION_USE_ANIMATED_GIF_URL, false); ChromeFeatureList.VIDEO_TUTORIALS, VARIATION_USE_ANIMATED_GIF_URL, true);
ImageFetcher.Params params = ImageFetcher.Params.create( ImageFetcher.Params params = ImageFetcher.Params.create(
useAnimatedGifUrl ? tutorial.animatedGifUrl : tutorial.thumbnailUrl, useAnimatedGifUrl ? tutorial.animatedGifUrl : tutorial.thumbnailUrl,
ImageFetcher.VIDEO_TUTORIALS_IPH_UMA_CLIENT_NAME, widthPx, heightPx); ImageFetcher.VIDEO_TUTORIALS_IPH_UMA_CLIENT_NAME, widthPx, heightPx);
......
...@@ -227,4 +227,22 @@ public class VideoPlayerMediatorUnitTest { ...@@ -227,4 +227,22 @@ public class VideoPlayerMediatorUnitTest {
Assert.assertTrue(VideoTutorialUtils.shouldShowTryNow(FeatureType.VOICE_SEARCH)); Assert.assertTrue(VideoTutorialUtils.shouldShowTryNow(FeatureType.VOICE_SEARCH));
Assert.assertFalse(VideoTutorialUtils.shouldShowTryNow(99)); Assert.assertFalse(VideoTutorialUtils.shouldShowTryNow(99));
} }
@Test
public void testVideoPlayerURL() {
String videoUrl = "https://example/video.mp4";
String posterUrl = "https://example/poster.png";
String animationUrl = "https://example/anim.gif";
String thumbnailUrl = "https://example/thumb.png";
String captionUrl = "https://example/caption.vtt";
String shareUrl = "https://example/share.mp4";
Tutorial testTutorial = new Tutorial(FeatureType.CHROME_INTRO, "title", videoUrl, posterUrl,
animationUrl, thumbnailUrl, captionUrl, shareUrl, 25);
assertThat(VideoPlayerURLBuilder.buildFromTutorial(testTutorial),
equalTo("chrome-untrusted://video-tutorials/"
+ "?video_url=https://example/video.mp4"
+ "&poster_url=https://example/poster.png"
+ "&caption_url=https://example/caption.vtt"));
}
} }
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