Use local theme attributes in the VD CTS test.

b/27325840

Change-Id: I2ecd0b9a04fdf043d1aa1cf2d7ca81d53af1277b
diff --git a/tests/tests/graphics/res/color/fill_gradient_linear.xml b/tests/tests/graphics/res/color/fill_gradient_linear.xml
index e0e3f03..d9b7497 100644
--- a/tests/tests/graphics/res/color/fill_gradient_linear.xml
+++ b/tests/tests/graphics/res/color/fill_gradient_linear.xml
@@ -18,8 +18,8 @@
 -->
 <gradient xmlns:android="http://schemas.android.com/apk/res/android"
           android:angle="90"
-          android:startColor="?android:attr/colorPrimary"
-          android:endColor="?android:attr/colorControlActivated"
+          android:startColor="?attr/themeColor"
+          android:endColor="#0f0"
           android:centerColor="#00ff0000"
           android:startX="0"
           android:startY="0"
diff --git a/tests/tests/graphics/res/color/fill_gradient_linear_item.xml b/tests/tests/graphics/res/color/fill_gradient_linear_item.xml
index cfb1236..c1fb560 100644
--- a/tests/tests/graphics/res/color/fill_gradient_linear_item.xml
+++ b/tests/tests/graphics/res/color/fill_gradient_linear_item.xml
@@ -18,15 +18,15 @@
 -->
 <gradient xmlns:android="http://schemas.android.com/apk/res/android"
           android:angle="90"
-          android:startColor="?android:attr/colorPrimary"
-          android:endColor="?android:attr/colorControlActivated"
+          android:startColor="?attr/themeColor"
+          android:endColor="#0f0"
           android:centerColor="#f00"
           android:startX="0"
           android:startY="0"
           android:endX="100"
           android:endY="100"
           android:type="linear">
-    <item android:offset="0.1" android:color="?android:attr/colorPrimary"/>
+    <item android:offset="0.1" android:color="?attr/themeColor"/>
     <item android:offset="0.4" android:color="#fff"/>
-    <item android:offset="0.9" android:color="?android:attr/colorControlActivated"/>
+    <item android:offset="0.9" android:color="#0f0"/>
 </gradient>
\ No newline at end of file
diff --git a/tests/tests/graphics/res/color/fill_gradient_linear_item_overlap.xml b/tests/tests/graphics/res/color/fill_gradient_linear_item_overlap.xml
index 18274b9..a5b261a 100644
--- a/tests/tests/graphics/res/color/fill_gradient_linear_item_overlap.xml
+++ b/tests/tests/graphics/res/color/fill_gradient_linear_item_overlap.xml
@@ -18,16 +18,16 @@
 -->
 <gradient xmlns:android="http://schemas.android.com/apk/res/android"
           android:angle="90"
-          android:startColor="?android:attr/colorPrimary"
-          android:endColor="?android:attr/colorControlActivated"
+          android:startColor="?attr/themeColor"
+          android:endColor="#0f0"
           android:centerColor="#f00"
           android:startX="0"
           android:startY="0"
           android:endX="100"
           android:endY="100"
           android:type="linear">
-    <item android:offset="0.1" android:color="?android:attr/colorPrimary"/>
+    <item android:offset="0.1" android:color="?attr/themeColor"/>
     <item android:offset="0.4" android:color="#f00"/>
     <item android:offset="0.4" android:color="#fff"/>
-    <item android:offset="0.9" android:color="?android:attr/colorControlActivated"/>
+    <item android:offset="0.9" android:color="#0f0"/>
 </gradient>
\ No newline at end of file
diff --git a/tests/tests/graphics/res/color/fill_gradient_radial.xml b/tests/tests/graphics/res/color/fill_gradient_radial.xml
index ef6fd70..389a0fc 100644
--- a/tests/tests/graphics/res/color/fill_gradient_radial.xml
+++ b/tests/tests/graphics/res/color/fill_gradient_radial.xml
@@ -18,10 +18,10 @@
 -->
 <gradient xmlns:android="http://schemas.android.com/apk/res/android"
           android:centerColor="#ff0000"
-          android:endColor="?android:attr/colorControlActivated"
+          android:endColor="#0f0"
           android:centerX="300"
           android:centerY="300"
           android:gradientRadius="100"
-          android:startColor="?android:attr/colorPrimary"
+          android:startColor="?attr/themeColor"
           android:type="radial">
 </gradient>
\ No newline at end of file
diff --git a/tests/tests/graphics/res/color/fill_gradient_radial_item.xml b/tests/tests/graphics/res/color/fill_gradient_radial_item.xml
index c6cea7c..2f116c9 100644
--- a/tests/tests/graphics/res/color/fill_gradient_radial_item.xml
+++ b/tests/tests/graphics/res/color/fill_gradient_radial_item.xml
@@ -24,7 +24,7 @@
           android:gradientRadius="100"
           android:startColor="#ffffffff"
           android:type="radial">
-    <item android:offset="0.1" android:color="?android:attr/colorPrimary"/>
+    <item android:offset="0.1" android:color="?attr/themeColor"/>
     <item android:offset="0.4" android:color="#fff"/>
-    <item android:offset="0.9" android:color="?android:attr/colorControlActivated"/>
+    <item android:offset="0.9" android:color="#0f0"/>
 </gradient>
\ No newline at end of file
diff --git a/tests/tests/graphics/res/color/fill_gradient_radial_item_short.xml b/tests/tests/graphics/res/color/fill_gradient_radial_item_short.xml
index fefbe9f..111d023 100644
--- a/tests/tests/graphics/res/color/fill_gradient_radial_item_short.xml
+++ b/tests/tests/graphics/res/color/fill_gradient_radial_item_short.xml
@@ -21,6 +21,6 @@
           android:centerY="300"
           android:gradientRadius="100"
           android:type="radial">
-    <item android:offset="0.1" android:color="?android:attr/colorPrimary"/>
-    <item android:offset="0.9" android:color="?android:attr/colorControlActivated"/>
+    <item android:offset="0.1" android:color="?attr/themeColor"/>
+    <item android:offset="0.9" android:color="#0f0"/>
 </gradient>
\ No newline at end of file
diff --git a/tests/tests/graphics/res/color/fill_gradient_sweep_item.xml b/tests/tests/graphics/res/color/fill_gradient_sweep_item.xml
index 332b9389..2a010c0 100644
--- a/tests/tests/graphics/res/color/fill_gradient_sweep_item.xml
+++ b/tests/tests/graphics/res/color/fill_gradient_sweep_item.xml
@@ -24,7 +24,7 @@
           android:gradientRadius="10"
           android:startColor="#ffffffff"
           android:type="sweep">
-    <item android:offset="0.1" android:color="?android:attr/colorPrimary"/>
+    <item android:offset="0.1" android:color="?attr/themeColor"/>
     <item android:offset="0.4" android:color="#fff"/>
-    <item android:offset="0.9" android:color="?android:attr/colorControlActivated"/>
+    <item android:offset="0.9" android:color="#0f0"/>
 </gradient>
diff --git a/tests/tests/graphics/res/color/fill_gradient_sweep_item_long.xml b/tests/tests/graphics/res/color/fill_gradient_sweep_item_long.xml
index 3931288..7b0bbef 100644
--- a/tests/tests/graphics/res/color/fill_gradient_sweep_item_long.xml
+++ b/tests/tests/graphics/res/color/fill_gradient_sweep_item_long.xml
@@ -22,9 +22,9 @@
           android:gradientRadius="10"
           android:type="sweep">
     <item android:offset="-0.3" android:color="#f00"/>
-    <item android:offset="0.1" android:color="?android:attr/colorPrimary"/>
+    <item android:offset="0.1" android:color="?attr/themeColor"/>
     <item android:offset="0.4" android:color="#0f0"/>
     <item android:offset="0.6" android:color="#00f"/>
-    <item android:offset="0.7" android:color="?android:attr/colorControlActivated"/>
+    <item android:offset="0.7" android:color="#0f0"/>
     <item android:offset="1.5" android:color="#00f"/>
 </gradient>
diff --git a/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_1_golden.png b/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_1_golden.png
index 638802f..d5288d1 100644
--- a/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_1_golden.png
+++ b/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_1_golden.png
Binary files differ
diff --git a/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_2_golden.png b/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_2_golden.png
index 1f248e3..54fbca7 100644
--- a/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_2_golden.png
+++ b/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_2_golden.png
Binary files differ
diff --git a/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_3_golden.png b/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_3_golden.png
index 085e72a..09fd92f 100644
--- a/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_3_golden.png
+++ b/tests/tests/graphics/res/drawable-nodpi/vector_icon_gradient_3_golden.png
Binary files differ
diff --git a/tests/tests/graphics/src/android/graphics/drawable/cts/VectorDrawableTest.java b/tests/tests/graphics/src/android/graphics/drawable/cts/VectorDrawableTest.java
index f174f01..ac1d9b3 100644
--- a/tests/tests/graphics/src/android/graphics/drawable/cts/VectorDrawableTest.java
+++ b/tests/tests/graphics/src/android/graphics/drawable/cts/VectorDrawableTest.java
@@ -197,7 +197,9 @@
                 throw new XmlPullParserException("No start tag found");
             }
 
-            mVectorDrawable.inflate(mResources, parser, attrs, mContext.getTheme());
+            Theme theme = mResources.newTheme();
+            theme.applyStyle(R.style.Theme_ThemedDrawableTest, true);
+            mVectorDrawable.inflate(mResources, parser, attrs, theme);
 
             if (stateSet != null) {
                 mVectorDrawable.setState(stateSet);