summaryrefslogtreecommitdiffstats
path: root/android_webview/javatests/src/org/chromium
diff options
context:
space:
mode:
authornewt <newt@chromium.org>2015-12-17 17:39:18 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-18 01:40:25 +0000
commita00d675dd71a328bc09b1de793756f98ce79caf2 (patch)
tree31c0d241558d38705556290b5e90372dba861f53 /android_webview/javatests/src/org/chromium
parent3843192fb540302ab1e488e9d1d34afb789c6e45 (diff)
downloadchromium_src-a00d675dd71a328bc09b1de793756f98ce79caf2.zip
chromium_src-a00d675dd71a328bc09b1de793756f98ce79caf2.tar.gz
chromium_src-a00d675dd71a328bc09b1de793756f98ce79caf2.tar.bz2
Use hex ints instead of Color.rgb().
This replaces calls to Color.rgb() that generate fixed colors with hex int representations of those colors. E.g. Color.rgb(255, 0, 0) becomes 0xFFFF0000. This follows the pattern typically used in our code, and allows the colors to be inlined constants instead of requiring runtime computation. BUG= Review URL: https://codereview.chromium.org/1529353003 Cr-Commit-Position: refs/heads/master@{#365972}
Diffstat (limited to 'android_webview/javatests/src/org/chromium')
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java3
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java9
2 files changed, 5 insertions, 7 deletions
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java
index abf9094..f417b69 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java
@@ -4,7 +4,6 @@
package org.chromium.android_webview.test;
-import android.graphics.Color;
import android.test.suitebuilder.annotation.SmallTest;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
@@ -321,7 +320,7 @@ public class AndroidViewIntegrationTest extends AwTestBase {
mOnContentSizeChangedHelper, expectedWidthCss, expectedHeightCss, false);
GraphicsTestUtils.pollForBackgroundColor(
- testContainerView.getAwContents(), Color.rgb(0x22, 0x77, 0x88));
+ testContainerView.getAwContents(), 0xFF227788);
}
@SmallTest
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
index a1a6c07..47aefc5 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
@@ -63,16 +63,15 @@ public class AwContentsRenderTest extends AwTestBase {
loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
"data:text/html,<html><head><style>body {background-color:#227788}</style></head>"
+ "<body></body></html>");
- GraphicsTestUtils.pollForBackgroundColor(mAwContents, Color.rgb(0x22, 0x77, 0x88));
+ final int teal = 0xFF227788;
+ GraphicsTestUtils.pollForBackgroundColor(mAwContents, teal);
// Changing the base background should not override CSS background.
setBackgroundColorOnUiThread(Color.MAGENTA);
- assertEquals(Color.rgb(0x22, 0x77, 0x88),
- GraphicsTestUtils.sampleBackgroundColorOnUiThread(mAwContents));
+ assertEquals(teal, GraphicsTestUtils.sampleBackgroundColorOnUiThread(mAwContents));
// ...setting the background is asynchronous, so pause a bit and retest just to be sure.
Thread.sleep(500);
- assertEquals(Color.rgb(0x22, 0x77, 0x88),
- GraphicsTestUtils.sampleBackgroundColorOnUiThread(mAwContents));
+ assertEquals(teal, GraphicsTestUtils.sampleBackgroundColorOnUiThread(mAwContents));
}
@SmallTest