Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8220e3e2 authored by Zemiao Zhu's avatar Zemiao Zhu Committed by Automerger Merge Worker
Browse files

Exclude color related tests for S to use dynamic color. am: cbb7fdb1

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/DocumentsUI/+/14460782

Change-Id: I9e01239a609a0f65f54fbfe551049603482ea77e
parents 270a1b23 cbb7fdb1
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.documentsui.ui;

import static org.junit.Assume.assumeFalse;

import android.content.Context;
import android.content.res.Configuration;

@@ -24,6 +26,7 @@ import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;

import com.android.documentsui.tests.R;
import com.android.documentsui.util.VersionUtils;

import org.junit.Before;
import org.junit.Test;
@@ -47,6 +50,7 @@ public class DarkThemeUiTest extends ThemeUiTestBase {

    @Test
    public void themeNightModeEnable_actionBarColorShouldBeDark() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.ThemeColor, R.styleable.ThemeColor_android_colorBackground,
                mTheme.getResources().getColor(com.android.documentsui.R.color.app_background_color,
                        mTheme));
@@ -72,6 +76,7 @@ public class DarkThemeUiTest extends ThemeUiTestBase {

    @Test
    public void themeNightModeEnable_windowBackgroundColorShouldBeDark() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.SystemWindow, R.styleable.SystemWindow_android_windowBackground,
                mTheme.getResources().getColor(com.android.documentsui.R.color.app_background_color,
                        mTheme));
@@ -79,6 +84,7 @@ public class DarkThemeUiTest extends ThemeUiTestBase {

    @Test
    public void themeNightModeEnable_statusBarColorShouldBeDark() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.SystemWindow, R.styleable.SystemWindow_android_statusBarColor,
                mTheme.getResources().getColor(com.android.documentsui.R.color.app_background_color,
                        mTheme));
@@ -86,6 +92,7 @@ public class DarkThemeUiTest extends ThemeUiTestBase {

    @Test
    public void appCompatThemeNightModeEnable_colorPrimaryShouldBeThemeable() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.ThemeColor, R.styleable.ThemeColor_android_colorPrimary,
                mTheme.getResources().getColor(com.android.documentsui.R.color.primary, mTheme));
    }
+9 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.documentsui.ui;

import static org.junit.Assume.assumeFalse;

import android.content.res.Configuration;
import android.graphics.Color;

@@ -23,6 +25,7 @@ import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;

import com.android.documentsui.tests.R;
import com.android.documentsui.util.VersionUtils;

import org.junit.Before;
import org.junit.Test;
@@ -44,6 +47,7 @@ public class ThemeUiTest extends ThemeUiTestBase {

    @Test
    public void themeNightModeDisable_actionBarColorShouldBeLight() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.ThemeColor, R.styleable.ThemeColor_android_colorBackground,
                Color.WHITE);
    }
@@ -62,24 +66,28 @@ public class ThemeUiTest extends ThemeUiTestBase {

    @Test
    public void themeNightModeDisable_navigationBarColorShouldBeLight() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.SystemWindow, R.styleable.SystemWindow_android_navigationBarColor,
                Color.WHITE);
    }

    @Test
    public void themeNightModeDisable_windowBackgroundColorShouldBeLight() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.SystemWindow, R.styleable.SystemWindow_android_windowBackground,
                Color.WHITE);
    }

    @Test
    public void themeNightModeDisable_statusBarColorShouldBeLight() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.SystemWindow, R.styleable.SystemWindow_android_statusBarColor,
                Color.WHITE);
    }

    @Test
    public void appCompatThemeNightModeDisable_colorPrimaryShouldBeThemeable() {
        assumeFalse(VersionUtils.isAtLeastS()); // Disable for S dynamic color
        assertTheme(R.styleable.ThemeColor, R.styleable.ThemeColor_android_colorPrimary,
                mTheme.getResources().getColor(com.android.documentsui.R.color.primary, mTheme));
    }