| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.toolbar; | 5 package org.chromium.chrome.browser.toolbar; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.graphics.Color; | 8 import android.graphics.Color; |
| 9 import android.os.Build; | 9 import android.os.Build; |
| 10 import android.test.suitebuilder.annotation.SmallTest; | 10 import android.test.suitebuilder.annotation.SmallTest; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 */ | 140 */ |
| 141 @SmallTest | 141 @SmallTest |
| 142 @Restriction(Restriction.RESTRICTION_TYPE_PHONE) | 142 @Restriction(Restriction.RESTRICTION_TYPE_PHONE) |
| 143 @Feature({"Omnibox"}) | 143 @Feature({"Omnibox"}) |
| 144 public void testBrandColorWithLoadStarted() throws InterruptedException { | 144 public void testBrandColorWithLoadStarted() throws InterruptedException { |
| 145 startMainActivityWithURL(getUrlWithBrandColor(BRAND_COLOR_1)); | 145 startMainActivityWithURL(getUrlWithBrandColor(BRAND_COLOR_1)); |
| 146 ThreadUtils.postOnUiThread(new Runnable() { | 146 ThreadUtils.postOnUiThread(new Runnable() { |
| 147 @Override | 147 @Override |
| 148 public void run() { | 148 public void run() { |
| 149 getActivity().getActivityTab() | 149 getActivity().getActivityTab() |
| 150 .getTabWebContentsDelegateAndroid().onLoadStarted(); | 150 .getTabWebContentsDelegateAndroid().onLoadStarted(true); |
| 151 } | 151 } |
| 152 }); | 152 }); |
| 153 checkForBrandColor(Color.parseColor(BRAND_COLOR_1)); | 153 checkForBrandColor(Color.parseColor(BRAND_COLOR_1)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 /** | 156 /** |
| 157 * Test for checking navigating to new brand color updates correctly. | 157 * Test for checking navigating to new brand color updates correctly. |
| 158 */ | 158 */ |
| 159 @SmallTest | 159 @SmallTest |
| 160 @Restriction(Restriction.RESTRICTION_TYPE_PHONE) | 160 @Restriction(Restriction.RESTRICTION_TYPE_PHONE) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 assertTrue(CriteriaHelper.pollForUIThreadCriteria(new Criteria() { | 221 assertTrue(CriteriaHelper.pollForUIThreadCriteria(new Criteria() { |
| 222 @Override | 222 @Override |
| 223 public boolean isSatisfied() { | 223 public boolean isSatisfied() { |
| 224 return getActivity().getActivityTab().isShowingInterstitialPage(
); | 224 return getActivity().getActivityTab().isShowingInterstitialPage(
); |
| 225 } | 225 } |
| 226 })); | 226 })); |
| 227 checkForBrandColor(ApiCompatibilityUtils.getColor( | 227 checkForBrandColor(ApiCompatibilityUtils.getColor( |
| 228 getActivity().getResources(), R.color.default_primary_color)); | 228 getActivity().getResources(), R.color.default_primary_color)); |
| 229 } | 229 } |
| 230 } | 230 } |
| OLD | NEW |