Commit cfbd0b88 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

[Android] Use adaptive color for sync related icons in dark mode

The sync related icons will now change color depending of light mode or
dark mode.

Screenshot: https://crbug.com/1109149#c3
Bug: 1109149
Change-Id: I631b6940f2ced0903f3687bd6ce84b5cbe7c0ccb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362807
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarAlice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800542}
parent 130501f2
......@@ -13,5 +13,5 @@
<path
android:pathData="M19.9998,21.5834V18.4834H27.7998C27.9165,19.0084 28.0082,19.5 28.0082,20.1917C28.0082,24.95 24.8165,28.3334 20.0082,28.3334C15.3998,28.3334 11.6665,24.6 11.6665,20C11.6665,15.4 15.3998,11.6667 19.9998,11.6667C22.2498,11.6667 24.1332,12.4917 25.5748,13.8417L23.2082,16.1417C22.6082,15.575 21.5665,14.9 19.9998,14.9C17.2415,14.9 14.9915,17.1917 14.9915,20C14.9915,22.8084 17.2415,25.1 19.9998,25.1C23.1915,25.1 24.3665,22.8917 24.5832,21.5834H19.9998V21.5834Z"
android:fillColor="@color/modern_grey_700"/>
android:fillColor="@color/default_icon_color_secondary"/>
</vector>
......@@ -14,9 +14,9 @@
<path
android:strokeWidth="1"
android:pathData="M10,20.5C15.799,20.5 20.5,15.799 20.5,10C20.5,4.201 15.799,-0.5 10,-0.5C4.201,-0.5 -0.5,4.201 -0.5,10C-0.5,15.799 4.201,20.5 10,20.5Z"
android:fillColor="#9AA0A6"
android:strokeColor="#ffffff"/>
android:fillColor="@color/default_icon_color_secondary"
android:strokeColor="@color/default_bg_color"/>
<path
android:pathData="M8.75,6.4688V5.1625C8.25,5.2937 7.7812,5.5 7.3562,5.7625L8.2687,6.675C8.425,6.6 8.5812,6.525 8.75,6.4688ZM4.2875,5.8812L5.7625,7.3562C5.2812,8.1187 5,9.025 5,10C5,11.3813 5.5687,12.625 6.475,13.525L5,15H8.75V11.25L7.35,12.65C6.675,11.9687 6.25,11.0375 6.25,10C6.25,9.375 6.4062,8.7875 6.675,8.2688L11.725,13.3187C11.5687,13.4 11.4125,13.475 11.2437,13.5312V14.8375C11.7437,14.7062 12.2125,14.5 12.6375,14.2375L14.1125,15.7125L14.9062,14.9188L5.0875,5.0875L4.2875,5.8812ZM15,5H11.25V8.75L12.65,7.35C13.325,8.0313 13.75,8.9625 13.75,10C13.75,10.625 13.5937,11.2125 13.325,11.7313L14.2375,12.6437C14.7187,11.8812 15,10.975 15,10C15,8.6187 14.4312,7.375 13.525,6.475L15,5Z"
android:fillColor="#ffffff"/>
android:fillColor="@color/default_bg_color"/>
</vector>
......@@ -14,9 +14,9 @@
<path
android:strokeWidth="1"
android:pathData="M20,30.5C25.799,30.5 30.5,25.799 30.5,20C30.5,14.201 25.799,9.5 20,9.5C14.201,9.5 9.5,14.201 9.5,20C9.5,25.799 14.201,30.5 20,30.5Z"
android:fillColor="@color/google_red_600"
android:strokeColor="@color/modern_white"/>
android:fillColor="@color/default_text_color_error"
android:strokeColor="@color/default_bg_color"/>
<path
android:pathData="M18.7501,16.4687V15.1625C18.2501,15.2938 17.7813,15.5 17.3563,15.7625L18.2688,16.675C18.4251,16.6 18.5813,16.525 18.7501,16.4687ZM14.2876,15.8812L15.7626,17.3562C15.2813,18.1188 15.0001,19.025 15.0001,20C15.0001,21.3813 15.5688,22.625 16.4751,23.525L15.0001,25H18.7501V21.25L17.3501,22.65C16.6751,21.9687 16.2501,21.0375 16.2501,20C16.2501,19.375 16.4063,18.7875 16.6751,18.2687L21.7251,23.3187C21.5688,23.4 21.4126,23.475 21.2438,23.5312V24.8375C21.7438,24.7062 22.2126,24.5 22.6376,24.2375L24.1126,25.7125L24.9063,24.9188L15.0876,15.0875L14.2876,15.8812ZM25.0001,15H21.2501V18.75L22.6501,17.35C23.3251,18.0313 23.7501,18.9625 23.7501,20C23.7501,20.625 23.5938,21.2125 23.3251,21.7313L24.2376,22.6437C24.7188,21.8812 25.0001,20.975 25.0001,20C25.0001,18.6187 24.4313,17.375 23.5251,16.475L25.0001,15Z"
android:fillColor="@color/modern_white"/>
android:fillColor="@color/default_bg_color"/>
</vector>
......@@ -14,9 +14,9 @@
<path
android:strokeWidth="1"
android:pathData="M20,30.5C25.799,30.5 30.5,25.799 30.5,20C30.5,14.201 25.799,9.5 20,9.5C14.201,9.5 9.5,14.201 9.5,20C9.5,25.799 14.201,30.5 20,30.5Z"
android:fillColor="@color/modern_grey_500"
android:strokeColor="@color/modern_white"/>
android:fillColor="@color/default_icon_color_secondary"
android:strokeColor="@color/default_bg_color"/>
<path
android:pathData="M18.7501,16.4687V15.1625C18.2501,15.2938 17.7813,15.5 17.3563,15.7625L18.2688,16.675C18.4251,16.6 18.5813,16.525 18.7501,16.4687ZM14.2876,15.8812L15.7626,17.3562C15.2813,18.1188 15.0001,19.025 15.0001,20C15.0001,21.3813 15.5688,22.625 16.4751,23.525L15.0001,25H18.7501V21.25L17.3501,22.65C16.6751,21.9687 16.2501,21.0375 16.2501,20C16.2501,19.375 16.4063,18.7875 16.6751,18.2687L21.7251,23.3187C21.5688,23.4 21.4126,23.475 21.2438,23.5312V24.8375C21.7438,24.7062 22.2126,24.5 22.6376,24.2375L24.1126,25.7125L24.9063,24.9188L15.0876,15.0875L14.2876,15.8812ZM25.0001,15H21.2501V18.75L22.6501,17.35C23.3251,18.0313 23.7501,18.9625 23.7501,20C23.7501,20.625 23.5938,21.2125 23.3251,21.7313L24.2376,22.6437C24.7188,21.8812 25.0001,20.975 25.0001,20C25.0001,18.6187 24.4313,17.375 23.5251,16.475L25.0001,15Z"
android:fillColor="@color/modern_white"/>
android:fillColor="@color/default_bg_color"/>
</vector>
......@@ -14,10 +14,10 @@
<path
android:strokeWidth="1"
android:pathData="M20,30.5C25.799,30.5 30.5,25.799 30.5,20C30.5,14.201 25.799,9.5 20,9.5C14.201,9.5 9.5,14.201 9.5,20C9.5,25.799 14.201,30.5 20,30.5Z"
android:fillColor="@color/google_green_600"
android:strokeColor="@color/modern_white"/>
android:fillColor="@color/default_green"
android:strokeColor="@color/default_bg_color"/>
<path
android:pathData="M17.3482,22.6516C15.8854,21.1888 15.8854,18.8112 17.3482,17.3483C17.7946,16.902 18.3293,16.5882 18.895,16.4203L18.895,15.1298C18.0067,15.3287 17.1582,15.7706 16.4643,16.4644C14.5109,18.4178 14.5109,21.5821 16.4643,23.5355L15.1385,24.8613L18.674,24.8613L18.674,21.3258L17.3482,22.6516ZM23.5354,16.4644L24.8612,15.1386L21.3257,15.1386L21.3257,18.6742L22.6515,17.3483C24.1143,18.8112 24.1143,21.1888 22.6515,22.6516C22.2051,23.098 21.6704,23.4118 21.1047,23.5797L21.1047,24.8702C21.993,24.6713 22.8415,24.2294 23.5354,23.5355C25.4888,21.5821 25.4888,18.4178 23.5354,16.4644Z"
android:fillColor="@color/modern_white"
android:fillColor="@color/default_bg_color"
android:fillType="evenOdd"/>
</vector>
......@@ -4,43 +4,44 @@
package org.chromium.chrome.browser.bookmarks;
import static org.mockito.MockitoAnnotations.initMocks;
import android.view.View;
import androidx.test.filters.MediumTest;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.chromium.base.test.params.ParameterAnnotations;
import org.chromium.base.test.params.ParameterizedRunner;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisableIf;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.app.ChromeActivity;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.signin.SigninActivityLauncherImpl;
import org.chromium.chrome.browser.night_mode.ChromeNightModeTestUtils;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate;
import org.chromium.chrome.test.util.BookmarkTestRule;
import org.chromium.chrome.test.util.ChromeRenderTestRule;
import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule;
import org.chromium.components.signin.ProfileDataSource;
import org.chromium.components.signin.test.util.FakeProfileDataSource;
import org.chromium.ui.test.util.NightModeTestUtils;
import org.chromium.ui.test.util.UiDisableIf;
import java.io.IOException;
/**
* Tests for the personalized signin promo on the Bookmarks page.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@RunWith(ParameterizedRunner.class)
@ParameterAnnotations.UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@DisableIf.Device(type = {UiDisableIf.TABLET})
public class BookmarkPersonalizedPromoRenderTest {
......@@ -64,28 +65,40 @@ public class BookmarkPersonalizedPromoRenderTest {
public final ChromeRenderTestRule mRenderTestRule =
ChromeRenderTestRule.Builder.withPublicCorpus().build();
@Mock
private SigninActivityLauncherImpl mMockSigninActivityLauncherImpl;
@ParameterAnnotations.UseMethodParameterBefore(NightModeTestUtils.NightModeParams.class)
public void setupNightMode(boolean nightModeEnabled) {
ChromeNightModeTestUtils.setUpNightModeForChromeActivity(nightModeEnabled);
mRenderTestRule.setNightModeEnabled(nightModeEnabled);
}
@BeforeClass
public static void setUpBeforeActivityLaunched() {
ChromeNightModeTestUtils.setUpNightModeBeforeChromeActivityLaunched();
}
@Before
public void setUp() {
initMocks(this);
mAccountManagerTestRule.addAccount(new ProfileDataSource.ProfileData(
"test@gmail.com", null, "Full Name", "Given Name"));
SigninActivityLauncherImpl.setLauncherForTest(mMockSigninActivityLauncherImpl);
mActivityTestRule.startMainActivityOnBlankPage();
}
@After
public void tearDown() {
SigninActivityLauncherImpl.setLauncherForTest(null);
BookmarkPromoHeader.forcePromoStateForTests(null);
}
@AfterClass
public static void tearDownAfterActivityDestroyed() {
ChromeNightModeTestUtils.tearDownNightModeAfterChromeActivityDestroyed();
}
@Test
@MediumTest
@Feature("RenderTest")
public void testPersonalizedSigninPromoInBookmarkPage() throws IOException {
@ParameterAnnotations.UseMethodParameter(NightModeTestUtils.NightModeParams.class)
public void testPersonalizedSigninPromoInBookmarkPage(boolean nightModeEnabled)
throws Exception {
BookmarkPromoHeader.forcePromoStateForTests(
BookmarkPromoHeader.PromoState.PROMO_SIGNIN_PERSONALIZED);
mBookmarkTestRule.showBookmarkManager(mActivityTestRule.getActivity());
......@@ -95,7 +108,8 @@ public class BookmarkPersonalizedPromoRenderTest {
@Test
@MediumTest
@Feature("RenderTest")
public void testPersonalizedSyncPromoInBookmarkPage() throws Exception {
@ParameterAnnotations.UseMethodParameter(NightModeTestUtils.NightModeParams.class)
public void testPersonalizedSyncPromoInBookmarkPage(boolean nightModeEnabled) throws Exception {
BookmarkPromoHeader.forcePromoStateForTests(
BookmarkPromoHeader.PromoState.PROMO_SYNC_PERSONALIZED);
mBookmarkTestRule.showBookmarkManager(mActivityTestRule.getActivity());
......
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