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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/MockResourcesForLayout.java

Issue 1190103002: Make lint fail builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix exported crash for ChromeShellTest Created 5 years, 6 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
Index: chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/MockResourcesForLayout.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/MockResourcesForLayout.java b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/MockResourcesForLayout.java
index 946380104ca54f45927b349ebecf627000833f79..4c97d626f5d3556681af0d73cccd76b91c61160f 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/MockResourcesForLayout.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/MockResourcesForLayout.java
@@ -12,6 +12,8 @@ import android.graphics.drawable.Drawable;
import android.test.mock.MockResources;
import android.util.DisplayMetrics;
import android.util.SparseArray;
+import android.util.SparseBooleanArray;
+import android.util.SparseIntArray;
import org.chromium.chrome.R;
@@ -25,8 +27,8 @@ import org.chromium.chrome.R;
public class MockResourcesForLayout extends MockResources {
private final Resources mValidResources;
private final SparseArray<Float> mFloats = new SparseArray<Float>();
- private final SparseArray<Integer> mIntegers = new SparseArray<Integer>();
- private final SparseArray<Boolean> mBooleans = new SparseArray<Boolean>();
+ private final SparseIntArray mIntegers = new SparseIntArray();
+ private final SparseBooleanArray mBooleans = new SparseBooleanArray();
private final SparseArray<String> mStrings = new SparseArray<String>();
private final Drawable mDrawable = new ColorDrawable(Color.RED);
@@ -102,14 +104,14 @@ public class MockResourcesForLayout extends MockResources {
@Override
public int getInteger(int id) {
- final Integer value = mIntegers.get(id);
- return value != null ? value.intValue() : mValidResources.getInteger(id);
+ if (mIntegers.indexOfKey(id) < 0) mValidResources.getInteger(id);
+ return mIntegers.get(id);
}
@Override
public boolean getBoolean(int id) {
- final Boolean value = mBooleans.get(id);
- return value != null ? value.booleanValue() : mValidResources.getBoolean(id);
+ if (mBooleans.indexOfKey(id) < 0) mValidResources.getBoolean(id);
+ return mBooleans.get(id);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698