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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java

Issue 2384583002: Immediately set toolbar background color when not animating (Closed)
Patch Set: address comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java
index aaecf514691d5ed1eb498fadf33776cf612710dd..a745edd0827d5c75be79791d5801b9a6145e1b5a 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java
@@ -140,6 +140,28 @@ public class BrandColorTest extends ChromeActivityTestCaseBase<ChromeActivity> {
}
/**
+ * Test for immediately setting the brand color.
+ */
+ @SmallTest
+ @Restriction(ChromeRestriction.RESTRICTION_TYPE_PHONE)
+ @Feature({"Omnibox"})
+ public void testImmediateColorChange() throws InterruptedException {
+ startMainActivityWithURL(getUrlWithBrandColor(BRAND_COLOR_1));
+ checkForBrandColor(Color.parseColor(BRAND_COLOR_1));
+
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ getActivity().getToolbarManager().updatePrimaryColor(mDefaultColor, false);
+ // Since the color should change instantly, there is no need to use the criteria
+ // helper.
+ assertEquals(mToolbarDataProvider.getPrimaryColor(),
+ mToolbar.getBackgroundDrawable().getColor());
+ }
+ });
+ }
+
+ /**
* Test to make sure onLoadStarted doesn't reset the brand color.
*/
@SmallTest
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698