aboutsummaryrefslogtreecommitdiffstats
path: root/device_validator/dvlib/tests
diff options
context:
space:
mode:
Diffstat (limited to 'device_validator/dvlib/tests')
-rw-r--r--device_validator/dvlib/tests/Android.mk30
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java311
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/devices.xml290
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml155
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml134
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/devices_no_hardware.xml80
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml80
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml128
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml140
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.jpeg0
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.png0
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.jpeg0
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.png0
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.jpeg0
-rw-r--r--device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.png0
15 files changed, 1348 insertions, 0 deletions
diff --git a/device_validator/dvlib/tests/Android.mk b/device_validator/dvlib/tests/Android.mk
new file mode 100644
index 0000000..5094d7a
--- /dev/null
+++ b/device_validator/dvlib/tests/Android.mk
@@ -0,0 +1,30 @@
+# Copyright (C) 2012 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_JAVA_RESOURCE_DIRS := src
+
+LOCAL_MODULE := dvlib-tests
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_JAVA_LIBRARIES := \
+ dvlib \
+ junit
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java b/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java
new file mode 100644
index 0000000..174f27c
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java
@@ -0,0 +1,311 @@
+package com.android.dvlib;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Stack;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import junit.framework.TestCase;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class DeviceSchemaTest extends TestCase {
+
+ private void checkFailure(Map<String, String> replacements, String regex) throws Exception {
+ // Generate XML stream with replacements
+ InputStream xmlStream = getReplacedStream(replacements);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ URL location = DeviceSchemaTest.class.getResource(".");
+ File parent = new File(location.toURI());
+ assertFalse(
+ "Validation Assertion Failed, XML failed to validate when it was expected to pass\n",
+ DeviceSchema.validate(xmlStream, baos, parent));
+ assertTrue(String.format("Regex Assertion Failed:\nExpected: %s\nActual: %s\n", regex, baos
+ .toString().trim()), baos.toString().trim().matches(regex));
+ }
+
+ private void checkFailure(String resource, String regex) throws Exception {
+ URL location = DeviceSchemaTest.class.getResource(resource);
+ File xml = new File(location.toURI());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ assertFalse("Validation Assertion Failed, XML validated when it was expected to fail\n",
+ DeviceSchema.validate(new FileInputStream(xml), baos, xml.getParentFile()));
+ assertTrue(String.format("Regex Assertion Failed:\nExpected: %s\nActual: %s\n", regex, baos
+ .toString().trim()), baos.toString().trim().matches(regex));
+ }
+
+ private void checkSuccess(Map<String, String> replacements) throws Exception {
+ InputStream xmlStream = getReplacedStream(replacements);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ URL location = DeviceSchemaTest.class.getResource(".");
+ File parent = new File(location.toURI());
+ assertTrue(DeviceSchema.validate(xmlStream, baos, parent));
+ assertTrue(baos.toString().trim().matches(""));
+ }
+
+ private InputStream getReplacedStream(Map<String, String> replacements) throws Exception {
+ URL location = DeviceSchema.class.getResource("devices_minimal.xml");
+ File xml = new File(location.toURI());
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ SAXParser parser = factory.newSAXParser();
+ ReplacementHandler replacer = new ReplacementHandler(replacements);
+ parser.parse(xml, replacer);
+ Document doc = replacer.getGeneratedDocument();
+ Transformer tf = TransformerFactory.newInstance().newTransformer();
+ // Add indents so we're closer to user generated output
+ tf.setOutputProperty(OutputKeys.INDENT, "yes");
+ DOMSource source = new DOMSource(doc);
+ StringWriter out = new StringWriter();
+ StreamResult result = new StreamResult(out);
+ tf.transform(source, result);
+ return new ByteArrayInputStream(out.toString().getBytes("UTF-8"));
+ }
+
+ public void testValidXml() throws Exception {
+ URL location = DeviceSchemaTest.class.getResource("devices.xml");
+ File xml = new File(location.toURI());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ boolean result = DeviceSchema.validate(new FileInputStream(xml), baos, xml.getParentFile());
+ String output = baos.toString().trim();
+ assertTrue(
+ String.format(
+ "Validation Assertion Failed, XML failed to validate when it was expected to pass\n%s\n",output), result);
+ assertTrue(String.format("Regex Assertion Failed\nExpected No Output\nActual: %s\n", baos
+ .toString().trim()), baos.toString().trim().matches(""));
+ }
+
+ public void testNoHardware() throws Exception {
+ String regex = "Error: cvc-complex-type.2.4.a: Invalid content was found starting with "
+ + "element 'd:software'.*";
+ checkFailure("devices_no_hardware.xml", regex);
+ }
+
+ public void testNoSoftware() throws Exception {
+ String regex = "Error: cvc-complex-type.2.4.a: Invalid content was found starting with "
+ + "element 'd:state'.*";
+ checkFailure("devices_no_software.xml", regex);
+ }
+
+ public void testNoDefault() throws Exception {
+ String regex = "Error: No default state for device Galaxy Nexus.*";
+ checkFailure("devices_no_default.xml", regex);
+ }
+
+ public void testTooManyDefaults() throws Exception {
+ String regex = "Error: More than one default state for device Galaxy Nexus.*";
+ checkFailure("devices_too_many_defaults.xml", regex);
+ }
+
+ public void testNoStates() throws Exception {
+ String regex = "Error: cvc-complex-type.2.4.b: The content of element 'd:device' is not "
+ + "complete.*\nError: No default state for device Galaxy Nexus.*";
+ checkFailure("devices_no_states.xml", regex);
+ }
+
+ public void testBadMechanism() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_MECHANISM, "fanger");
+ checkFailure(replacements, "Error: cvc-enumeration-valid: Value 'fanger' is not "
+ + "facet-valid.*\nError: cvc-type.3.1.3: The value 'fanger' of element "
+ + "'d:mechanism' is not valid.*");
+ }
+
+ public void testNegativeXdpi() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_XDPI, "-1.0");
+ checkFailure(replacements, "Error: cvc-minInclusive-valid: Value '-1.0'.*\n"
+ + "Error: cvc-type.3.1.3: The value '-1.0' of element 'd:xdpi' is not valid.*");
+ }
+
+ public void testNegativeYdpi() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_YDPI, "-1");
+ checkFailure(replacements, "Error: cvc-minInclusive-valid: Value '-1'.*\n"
+ + "Error: cvc-type.3.1.3: The value '-1' of element 'd:ydpi' is not valid.*");
+
+ }
+
+ public void testNegativeDiagonalLength() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_DIAGONAL_LENGTH, "-1.0");
+
+ checkFailure(replacements, "Error: cvc-minInclusive-valid: Value '-1.0'.*\n"
+ + "Error: cvc-type.3.1.3: The value '-1.0' of element 'd:diagonal-length'.*");
+
+ }
+
+ public void testInvalidOpenGLVersion() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_GL_VERSION, "2");
+ checkFailure(replacements, "Error: cvc-pattern-valid: Value '2' is not facet-valid.*\n"
+ + "Error: cvc-type.3.1.3: The value '2' of element 'd:gl-version' is not valid.*");
+ }
+
+ public void testInvalidIconTypes() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_SIXTEEN, "extras/sixteen.jpeg");
+ replacements.put(DeviceSchema.NODE_SIXTY_FOUR, "extras/sixtyfour.jpeg");
+ replacements.put(DeviceSchema.NODE_PATH, "extras/frame.jpeg");
+ checkFailure(replacements, "Error: extras/sixtyfour.jpeg is not a valid file type.\n"
+ + "Error: extras/sixteen.jpeg is not a valid file type.\n"
+ + "Error: extras/frame.jpeg is not a valid file type.");
+ }
+
+ public void testMissingIcons() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_SIXTEEN, "extras/missing");
+ replacements.put(DeviceSchema.NODE_SIXTY_FOUR, "extras/missing");
+ replacements.put(DeviceSchema.NODE_PATH, "extras/missing");
+ checkFailure(replacements, "Error: extras/missing is not a valid path.\n"
+ + "Error: extras/missing is not a valid path.\n"
+ + "Error: extras/missing is not a valid path.");
+ }
+
+ public void testEmptyOpenGLExtensions() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_GL_EXTENSIONS, "");
+ checkSuccess(replacements);
+ }
+
+ public void testEmptySensors() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_SENSORS, "");
+ checkSuccess(replacements);
+ }
+
+ public void testEmptyNetworking() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_NETWORKING, "");
+ checkSuccess(replacements);
+ }
+
+ public void testEmptyCpu() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_CPU, "");
+ checkFailure(replacements, "Error: cvc-minLength-valid: Value '' with length = '0'.*\n"
+ + "Error: cvc-type.3.1.3: The value '' of element 'd:cpu' is not valid.*");
+ }
+
+ public void testEmptyGpu() throws Exception {
+ Map<String, String> replacements = new HashMap<String, String>();
+ replacements.put(DeviceSchema.NODE_GPU, "");
+ checkFailure(replacements, "Error: cvc-minLength-valid: Value '' with length = '0'.*\n"
+ + "Error: cvc-type.3.1.3: The value '' of element 'd:gpu' is not valid.*");
+ }
+
+ /**
+ * Reads in a valid devices XML file and if an element tag is in the
+ * replacements map, it replaces its text content with the corresponding
+ * value. Note this has no concept of namespaces or hierarchy, so it will
+ * replace the contents any and all elements with the specified tag name.
+ */
+ private static class ReplacementHandler extends DefaultHandler {
+ private Element mCurrElement = null;
+ private Document mDocument;
+ private final Stack<Element> mElementStack = new Stack<Element>();
+ private final Map<String, String> mPrefixes = new HashMap<String, String>();
+ private final Map<String, String> mReplacements;
+ private final StringBuilder mStringAccumulator = new StringBuilder();
+
+ public ReplacementHandler(Map<String, String> replacements) {
+ mReplacements = replacements;
+ }
+
+ @Override
+ public void startDocument() {
+ try {
+ mDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ } catch (ParserConfigurationException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String name, Attributes attributes) {
+ Element element = mDocument.createElement(name);
+ for (int i = 0; i < attributes.getLength(); i++) {
+ element.setAttribute(attributes.getQName(i), attributes.getValue(i));
+ }
+ for (String key : mPrefixes.keySet()) {
+ element.setAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":" + key, mPrefixes.get(key));
+ }
+ mPrefixes.clear();
+ if (mCurrElement != null) {
+ mElementStack.push(mCurrElement);
+ }
+ mCurrElement = element;
+ }
+
+ @Override
+ public void startPrefixMapping(String prefix, String uri) throws SAXException {
+ mPrefixes.put(prefix, uri);
+ }
+
+ @Override
+ public void characters(char[] ch, int start, int length) {
+ mStringAccumulator.append(ch, start, length);
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String name) throws SAXException {
+ if (mReplacements.containsKey(localName)) {
+ mCurrElement.appendChild(mDocument.createTextNode(mReplacements.get(localName)));
+ } else {
+ String content = mStringAccumulator.toString().trim();
+ if (!content.isEmpty()) {
+ mCurrElement.appendChild(mDocument.createTextNode(content));
+ }
+ }
+
+ if (mElementStack.empty()) {
+ mDocument.appendChild(mCurrElement);
+ mCurrElement = null;
+ } else {
+ Element parent = mElementStack.pop();
+ parent.appendChild(mCurrElement);
+ mCurrElement = parent;
+ }
+ mStringAccumulator.setLength(0);
+ }
+
+ @Override
+ public void error(SAXParseException e) {
+ fail(e.getMessage());
+ }
+
+ @Override
+ public void fatalError(SAXParseException e) {
+ fail(e.getMessage());
+ }
+
+ public Document getGeneratedDocument() {
+ return mDocument;
+ }
+
+ }
+}
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml
new file mode 100644
index 0000000..aeb0f04
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml
@@ -0,0 +1,290 @@
+<?xml version="1.0"?>
+<d:devices
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:d="http://schemas.android.com/sdk/devices/1">
+
+ <d:device>
+ <d:name>
+ Galaxy Nexus
+ </d:name>
+ <d:manufacturer>
+ Samsung
+ </d:manufacturer>
+ <d:meta>
+ <d:icons>
+ <d:sixty-four>
+ extras/sixtyfour.png
+ </d:sixty-four>
+ <d:sixteen>
+ extras/sixteen.png
+ </d:sixteen>
+ </d:icons>
+ <d:frame>
+ <d:path>
+ extras/frame.png
+ </d:path>
+ <d:portrait-x-offset>0</d:portrait-x-offset>
+ <d:portrait-y-offset>0</d:portrait-y-offset>
+ <d:landscape-x-offset>0</d:landscape-x-offset>
+ <d:landscape-y-offset>0</d:landscape-y-offset>
+ </d:frame>
+ </d:meta>
+ <d:hardware>
+ <d:screen>
+ <d:screen-size>normal</d:screen-size>
+ <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
+ <d:pixel-density>xhdpi</d:pixel-density>
+ <d:screen-ratio>long</d:screen-ratio>
+ <d:dimensions>
+ <d:x-dimension>720</d:x-dimension>
+ <d:y-dimension>1280</d:y-dimension>
+ </d:dimensions>
+ <d:xdpi>316</d:xdpi>
+ <d:ydpi>316</d:ydpi>
+ <d:touch>
+ <d:multitouch>jazz-hands</d:multitouch>
+ <d:mechanism>finger</d:mechanism>
+ <d:screen-type>capacitive</d:screen-type>
+ </d:touch>
+ </d:screen>
+ <d:networking>
+ Bluetooth
+ Wifi
+ NFC
+ </d:networking>
+ <d:sensors>
+ Accelerometer
+ Barometer
+ Gyroscope
+ Compass
+ GPS
+ ProximitySensor
+ </d:sensors>
+ <d:mic>true</d:mic>
+ <d:camera>
+ <d:location>front</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>false</d:flash>
+ </d:camera>
+ <d:camera>
+ <d:location>back</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>true</d:flash>
+ </d:camera>
+ <d:keyboard>nokeys</d:keyboard>
+ <d:nav>nonav</d:nav>
+ <d:ram unit="GiB">1</d:ram>
+ <d:buttons>soft</d:buttons>
+ <d:internal-storage unit="GiB">16</d:internal-storage>
+ <d:removable-storage unit="KiB"></d:removable-storage>
+ <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
+ <d:gpu>PowerVR SGX540</d:gpu>
+ <d:abi>
+ armeabi
+ armeabi-v7a
+ </d:abi>
+ <!--dock (car, desk, tv, none)-->
+ <d:dock>
+ </d:dock>
+ <!-- plugged in (never, charge, always) -->
+ <d:plugged-in>charge</d:plugged-in>
+ </d:hardware>
+ <d:software>
+ <d:api-level>14-</d:api-level>
+ <d:live-wallpaper-support>true</d:live-wallpaper-support>
+ <d:bluetooth-profiles>
+ HSP
+ HFP
+ SPP
+ A2DP
+ AVRCP
+ OPP
+ PBAP
+ GAVDP
+ AVDTP
+ HID
+ HDP
+ PAN
+ </d:bluetooth-profiles>
+ <d:gl-version>2.0</d:gl-version>
+ <!--
+ These can be gotten via
+ javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
+ -->
+ <d:gl-extensions>
+ GL_EXT_discard_framebuffer
+ GL_EXT_multi_draw_arrays
+ GL_EXT_shader_texture_lod
+ GL_EXT_texture_format_BGRA8888
+ GL_IMG_multisampled_render_to_texture
+ GL_IMG_program_binary
+ GL_IMG_read_format
+ GL_IMG_shader_binary
+ GL_IMG_texture_compression_pvrtc
+ GL_IMG_texture_format_BGRA8888
+ GL_IMG_texture_npot
+ GL_OES_compressed_ETC1_RGB8_texture
+ GL_OES_depth_texture
+ GL_OES_depth24
+ GL_OES_EGL_image
+ GL_OES_EGL_image_external
+ GL_OES_egl_sync
+ GL_OES_element_index_uint
+ GL_OES_fragment_precision_high
+ GL_OES_get_program_binary
+ GL_OES_mapbuffer
+ GL_OES_packed_depth_stencil
+ GL_OES_required_internalformat
+ GL_OES_rgb8_rgba8
+ GL_OES_standard_derivatives
+ GL_OES_texture_float
+ GL_OES_texture_half_float
+ GL_OES_vertex_array_object
+ GL_OES_vertex_half_float
+ </d:gl-extensions>
+ </d:software>
+ <d:state name="Portrait" default="true">
+ <d:description>The phone in portrait view</d:description>
+ <d:screen-orientation>portrait</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ <d:state name="Landscape">
+ <d:description>The phone in landscape view</d:description>
+ <d:screen-orientation>landscape</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ </d:device>
+ <d:device>
+ <d:name>Droid</d:name>
+ <d:manufacturer>Motorola</d:manufacturer>
+ <d:hardware>
+ <d:screen>
+ <d:screen-size>normal</d:screen-size>
+ <d:diagonal-length>3.7</d:diagonal-length>
+ <d:pixel-density>hdpi</d:pixel-density>
+ <d:screen-ratio>long</d:screen-ratio>
+ <d:dimensions>
+ <d:x-dimension>480</d:x-dimension>
+ <d:y-dimension>854</d:y-dimension>
+ </d:dimensions>
+ <d:xdpi>265</d:xdpi>
+ <d:ydpi>265</d:ydpi>
+ <d:touch>
+ <d:multitouch>distinct</d:multitouch>
+ <d:mechanism>finger</d:mechanism>
+ <d:screen-type>capacitive</d:screen-type>
+ </d:touch>
+ </d:screen>
+ <d:networking>
+ Bluetooth
+ Wifi
+ NFC
+ </d:networking>
+ <d:sensors>
+ Accelerometer
+ Barometer
+ Compass
+ GPS
+ ProximitySensor
+ LightSensor
+ </d:sensors>
+ <d:mic>true</d:mic>
+ <d:camera>
+ <d:location>back</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>true</d:flash>
+ </d:camera>
+ <d:keyboard>qwerty</d:keyboard>
+ <d:nav>dpad</d:nav>
+ <d:ram unit="MiB">256</d:ram>
+ <d:buttons>hard</d:buttons>
+ <d:internal-storage unit="MiB">512</d:internal-storage>
+ <d:removable-storage unit="GiB">16</d:removable-storage>
+ <d:cpu>OMAP 3430</d:cpu>
+ <d:gpu>PowerVR SGX 53</d:gpu>
+ <d:abi>
+ armeabi
+ armeabi-v7a
+ </d:abi>
+ <d:dock>
+ car
+ desk
+ </d:dock>
+ <d:plugged-in>charge</d:plugged-in>
+ </d:hardware>
+ <d:software>
+ <d:api-level>5-8</d:api-level>
+ <d:live-wallpaper-support>false</d:live-wallpaper-support>
+ <d:bluetooth-profiles>
+ GAP
+ SPP
+ HSP
+ HFP
+ A2DP
+ AVRCP
+ SDAP
+ </d:bluetooth-profiles>
+ <d:gl-version>1.1</d:gl-version>
+ <!--
+ These can be gotten via
+ javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
+ -->
+ <d:gl-extensions>
+ GL_OES_byte_coordinates
+ GL_OES_fixed_point
+ GL_OES_single_precision
+ GL_OES_matrix_get
+ GL_OES_read_format
+ GL_OES_compressed_paletted_texture
+ GL_OES_point_sprite
+ GL_OES_point_size_array
+ GL_OES_matrix_palette
+ GL_OES_draw_texture
+ GL_OES_query_matrix
+ GL_OES_texture_env_crossbar
+ GL_OES_texture_mirrored_repeat
+ GL_OES_texture_cube_map
+ GL_OES_blend_subtract
+ GL_OES_blend_func_separate
+ GL_OES_blend_equation_separate
+ GL_OES_stencil_wrap
+ GL_OES_extended_matrix_palette
+ GL_OES_framebuffer_object
+ GL_OES_rgb8_rgba8
+ GL_OES_depth24
+ GL_OES_stencil8
+ GL_OES_compressed_ETC1_RGB8_texture
+ GL_OES_mapbuffer
+ GL_OES_EGL_image
+ GL_EXT_multi_draw_arrays
+ GL_OES_required_internalformat
+ GL_IMG_read_format
+ GL_IMG_texture_compression_pvrtc
+ GL_IMG_texture_format_BGRA8888
+ GL_EXT_texture_format_BGRA8888
+ GL_IMG_texture_stream
+ GL_IMG_vertex_program
+ </d:gl-extensions>
+ </d:software>
+ <d:state name="Portrait" default="true">
+ <d:description>The phone in portrait view</d:description>
+ <d:screen-orientation>portrait</d:screen-orientation>
+ <d:keyboard-state>keyshidden</d:keyboard-state>
+ <d:nav-state>navhidden</d:nav-state>
+ </d:state>
+ <d:state name="Landscape, closed">
+ <d:description>The phone in landscape view with the keyboard closed</d:description>
+ <d:screen-orientation>landscape</d:screen-orientation>
+ <d:keyboard-state>keyshidden</d:keyboard-state>
+ <d:nav-state>navhidden</d:nav-state>
+ </d:state>
+ <d:state name="Landscape, open">
+ <d:description>The phone in landscape view with the keyboard open</d:description>
+ <d:screen-orientation>landscape</d:screen-orientation>
+ <d:keyboard-state>keysexposed</d:keyboard-state>
+ <d:nav-state>navexposed</d:nav-state>
+ </d:state>
+ </d:device>
+</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml
new file mode 100644
index 0000000..71ab61a
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<d:devices
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:d="http://schemas.android.com/sdk/devices/1">
+
+ <d:device>
+ <d:name>
+ Galaxy Nexus
+ </d:name>
+ <d:manufacturer>
+ Samsung
+ </d:manufacturer>
+ <d:meta>
+ <d:icons>
+ <d:sixty-four>
+ extras/sixtyfour.png
+ </d:sixty-four>
+ <d:sixteen>
+ extras/sixteen.png
+ </d:sixteen>
+ </d:icons>
+ <d:frame>
+ <d:path>
+ extras/frame.png
+ </d:path>
+ <d:portrait-x-offset>0</d:portrait-x-offset>
+ <d:portrait-y-offset>0</d:portrait-y-offset>
+ <d:landscape-x-offset>0</d:landscape-x-offset>
+ <d:landscape-y-offset>0</d:landscape-y-offset>
+ </d:frame>
+ </d:meta>
+ <d:hardware>
+ <d:screen>
+ <d:screen-size>normal</d:screen-size>
+ <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
+ <d:pixel-density>xhdpi</d:pixel-density>
+ <d:screen-ratio>long</d:screen-ratio>
+ <d:dimensions>
+ <d:x-dimension>720</d:x-dimension>
+ <d:y-dimension>1280</d:y-dimension>
+ </d:dimensions>
+ <d:xdpi>316</d:xdpi>
+ <d:ydpi>316</d:ydpi>
+ <d:touch>
+ <d:multitouch>jazz-hands</d:multitouch>
+ <d:mechanism>finger</d:mechanism>
+ <d:screen-type>capacitive</d:screen-type>
+ </d:touch>
+ </d:screen>
+ <d:networking>
+ Bluetooth
+ Wifi
+ NFC
+ </d:networking>
+ <d:sensors>
+ Accelerometer
+ Barometer
+ Gyroscope
+ Compass
+ GPS
+ ProximitySensor
+ </d:sensors>
+ <d:mic>true</d:mic>
+ <d:camera>
+ <d:location>front</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>false</d:flash>
+ </d:camera>
+ <d:camera>
+ <d:location>back</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>true</d:flash>
+ </d:camera>
+ <d:keyboard>nokeys</d:keyboard>
+ <d:nav>nonav</d:nav>
+ <d:ram unit="GiB">1</d:ram>
+ <d:buttons>soft</d:buttons>
+ <d:internal-storage unit="GiB">16</d:internal-storage>
+ <d:removable-storage unit="KiB"></d:removable-storage>
+ <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
+ <d:gpu>PowerVR SGX540</d:gpu>
+ <d:abi>
+ armeabi
+ armeabi-v7a
+ </d:abi>
+ <!--dock (car, desk, tv, none)-->
+ <d:dock>
+ </d:dock>
+ <!-- plugged in (never, charge, always) -->
+ <d:plugged-in>charge</d:plugged-in>
+ </d:hardware>
+ <d:software>
+ <d:api-level>15</d:api-level>
+ <d:live-wallpaper-support>true</d:live-wallpaper-support>
+ <d:bluetooth-profiles>
+ HSP
+ HFP
+ SPP
+ A2DP
+ AVRCP
+ OPP
+ PBAP
+ GAVDP
+ AVDTP
+ HID
+ HDP
+ PAN
+ </d:bluetooth-profiles>
+ <d:gl-version>2.0</d:gl-version>
+ <d:gl-extensions>
+ GL_EXT_discard_framebuffer
+ GL_EXT_multi_draw_arrays
+ GL_EXT_shader_texture_lod
+ GL_EXT_texture_format_BGRA8888
+ GL_IMG_multisampled_render_to_texture
+ GL_IMG_program_binary
+ GL_IMG_read_format
+ GL_IMG_shader_binary
+ GL_IMG_texture_compression_pvrtc
+ GL_IMG_texture_format_BGRA8888
+ GL_IMG_texture_npot
+ GL_OES_compressed_ETC1_RGB8_texture
+ GL_OES_depth_texture
+ GL_OES_depth24
+ GL_OES_EGL_image
+ GL_OES_EGL_image_external
+ GL_OES_egl_sync
+ GL_OES_element_index_uint
+ GL_OES_fragment_precision_high
+ GL_OES_get_program_binary
+ GL_OES_mapbuffer
+ GL_OES_packed_depth_stencil
+ GL_OES_required_internalformat
+ GL_OES_rgb8_rgba8
+ GL_OES_standard_derivatives
+ GL_OES_texture_float
+ GL_OES_texture_half_float
+ GL_OES_vertex_array_object
+ GL_OES_vertex_half_float
+ </d:gl-extensions>
+ </d:software>
+ <d:state name="Portrait" default="true">
+ <d:description>The phone in portrait view</d:description>
+ <d:screen-orientation>portrait</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ <d:state name="Landscape">
+ <d:description>The phone in landscape view</d:description>
+ <d:screen-orientation>landscape</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ </d:device>
+</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml
new file mode 100644
index 0000000..3ebcedb
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<d:devices
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:d="http://schemas.android.com/sdk/devices/1">
+
+ <d:device>
+ <d:name>
+ Galaxy Nexus
+ </d:name>
+ <d:manufacturer>
+ Samsung
+ </d:manufacturer>
+ <d:hardware>
+ <d:screen>
+ <d:screen-size>normal</d:screen-size>
+ <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
+ <d:pixel-density>xhdpi</d:pixel-density>
+ <d:screen-ratio>long</d:screen-ratio>
+ <d:dimensions>
+ <d:x-dimension>720</d:x-dimension>
+ <d:y-dimension>1280</d:y-dimension>
+ </d:dimensions>
+ <d:xdpi>316</d:xdpi>
+ <d:ydpi>316</d:ydpi>
+ <d:touch>
+ <d:multitouch>jazz-hands</d:multitouch>
+ <d:mechanism>finger</d:mechanism>
+ <d:screen-type>capacitive</d:screen-type>
+ </d:touch>
+ </d:screen>
+ <d:networking>
+ Bluetooth
+ Wifi
+ NFC
+ </d:networking>
+ <d:sensors>
+ Accelerometer
+ Barometer
+ Gyroscope
+ Compass
+ GPS
+ ProximitySensor
+ </d:sensors>
+ <d:mic>true</d:mic>
+ <d:camera>
+ <d:location>front</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>false</d:flash>
+ </d:camera>
+ <d:camera>
+ <d:location>back</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>true</d:flash>
+ </d:camera>
+ <d:keyboard>nokeys</d:keyboard>
+ <d:nav>nonav</d:nav>
+ <d:ram unit="GiB">1</d:ram>
+ <d:buttons>soft</d:buttons>
+ <d:internal-storage unit="GiB">16</d:internal-storage>
+ <d:removable-storage unit="KiB"></d:removable-storage>
+ <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
+ <d:gpu>PowerVR SGX540</d:gpu>
+ <d:abi>
+ armeabi
+ armeabi-v7a
+ </d:abi>
+ <!--dock (car, desk, tv, none)-->
+ <d:dock>
+ </d:dock>
+ <!-- plugged in (never, charge, always) -->
+ <d:plugged-in>charge</d:plugged-in>
+ </d:hardware>
+ <d:software>
+ <d:api-level>14</d:api-level>
+ <d:live-wallpaper-support>true</d:live-wallpaper-support>
+ <d:bluetooth-profiles>
+ HSP
+ HFP
+ SPP
+ A2DP
+ AVRCP
+ OPP
+ PBAP
+ GAVDP
+ AVDTP
+ HID
+ HDP
+ PAN
+ </d:bluetooth-profiles>
+ <d:gl-version>2.0</d:gl-version>
+ <!--
+ These can be gotten via
+ javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
+ -->
+ <d:gl-extensions>
+ GL_EXT_discard_framebuffer
+ GL_EXT_multi_draw_arrays
+ GL_EXT_shader_texture_lod
+ GL_EXT_texture_format_BGRA8888
+ GL_IMG_multisampled_render_to_texture
+ GL_IMG_program_binary
+ GL_IMG_read_format
+ GL_IMG_shader_binary
+ GL_IMG_texture_compression_pvrtc
+ GL_IMG_texture_format_BGRA8888
+ GL_IMG_texture_npot
+ GL_OES_compressed_ETC1_RGB8_texture
+ GL_OES_depth_texture
+ GL_OES_depth24
+ GL_OES_EGL_image
+ GL_OES_EGL_image_external
+ GL_OES_egl_sync
+ GL_OES_element_index_uint
+ GL_OES_fragment_precision_high
+ GL_OES_get_program_binary
+ GL_OES_mapbuffer
+ GL_OES_packed_depth_stencil
+ GL_OES_required_internalformat
+ GL_OES_rgb8_rgba8
+ GL_OES_standard_derivatives
+ GL_OES_texture_float
+ GL_OES_texture_half_float
+ GL_OES_vertex_array_object
+ GL_OES_vertex_half_float
+ </d:gl-extensions>
+ </d:software>
+ <d:state name="Portrait">
+ <d:description>The phone in portrait view</d:description>
+ <d:screen-orientation>portrait</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ </d:device>
+</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_hardware.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_hardware.xml
new file mode 100644
index 0000000..a5c3da1
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_hardware.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<d:devices
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:d="http://schemas.android.com/sdk/devices/1">
+
+ <d:device>
+ <d:name>
+ Galaxy Nexus
+ </d:name>
+ <d:manufacturer>
+ Samsung
+ </d:manufacturer>
+ <d:software>
+ <d:api-level>14</d:api-level>
+ <d:live-wallpaper-support>true</d:live-wallpaper-support>
+ <d:bluetooth-profiles>
+ HSP
+ HFP
+ SPP
+ A2DP
+ AVRCP
+ OPP
+ PBAP
+ GAVDP
+ AVDTP
+ HID
+ HDP
+ PAN
+ </d:bluetooth-profiles>
+ <d:gl-version>2.0</d:gl-version>
+ <!--
+ These can be gotten via
+ javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
+ -->
+ <d:gl-extensions>
+ GL_EXT_discard_framebuffer
+ GL_EXT_multi_draw_arrays
+ GL_EXT_shader_texture_lod
+ GL_EXT_texture_format_BGRA8888
+ GL_IMG_multisampled_render_to_texture
+ GL_IMG_program_binary
+ GL_IMG_read_format
+ GL_IMG_shader_binary
+ GL_IMG_texture_compression_pvrtc
+ GL_IMG_texture_format_BGRA8888
+ GL_IMG_texture_npot
+ GL_OES_compressed_ETC1_RGB8_texture
+ GL_OES_depth_texture
+ GL_OES_depth24
+ GL_OES_EGL_image
+ GL_OES_EGL_image_external
+ GL_OES_egl_sync
+ GL_OES_element_index_uint
+ GL_OES_fragment_precision_high
+ GL_OES_get_program_binary
+ GL_OES_mapbuffer
+ GL_OES_packed_depth_stencil
+ GL_OES_required_internalformat
+ GL_OES_rgb8_rgba8
+ GL_OES_standard_derivatives
+ GL_OES_texture_float
+ GL_OES_texture_half_float
+ GL_OES_vertex_array_object
+ GL_OES_vertex_half_float
+ </d:gl-extensions>
+ </d:software>
+ <d:state name="Portrait" default="true">
+ <d:description>The phone in portrait view</d:description>
+ <d:screen-orientation>portrait</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ <d:state name="Landscape">
+ <d:description>The phone in landscape view</d:description>
+ <d:screen-orientation>landscape</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ </d:device>
+</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml
new file mode 100644
index 0000000..899110a
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<d:devices
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:d="http://schemas.android.com/sdk/devices/1">
+
+ <d:device>
+ <d:name>
+ Galaxy Nexus
+ </d:name>
+ <d:manufacturer>
+ Samsung
+ </d:manufacturer>
+ <d:hardware>
+ <d:screen>
+ <d:screen-size>normal</d:screen-size>
+ <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
+ <d:pixel-density>xhdpi</d:pixel-density>
+ <d:screen-ratio>long</d:screen-ratio>
+ <d:dimensions>
+ <d:x-dimension>720</d:x-dimension>
+ <d:y-dimension>1280</d:y-dimension>
+ </d:dimensions>
+ <d:xdpi>316</d:xdpi>
+ <d:ydpi>316</d:ydpi>
+ <d:touch>
+ <d:multitouch>jazz-hands</d:multitouch>
+ <d:mechanism>finger</d:mechanism>
+ <d:screen-type>capacitive</d:screen-type>
+ </d:touch>
+ </d:screen>
+ <d:networking>
+ Bluetooth
+ Wifi
+ NFC
+ </d:networking>
+ <d:sensors>
+ Accelerometer
+ Barometer
+ Gyroscope
+ Compass
+ GPS
+ ProximitySensor
+ </d:sensors>
+ <d:mic>true</d:mic>
+ <d:camera>
+ <d:location>front</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>false</d:flash>
+ </d:camera>
+ <d:camera>
+ <d:location>back</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>true</d:flash>
+ </d:camera>
+ <d:keyboard>nokeys</d:keyboard>
+ <d:nav>nonav</d:nav>
+ <d:ram unit="GiB">1</d:ram>
+ <d:buttons>soft</d:buttons>
+ <d:internal-storage unit="GiB">16</d:internal-storage>
+ <d:removable-storage unit="KiB"></d:removable-storage>
+ <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
+ <d:gpu>PowerVR SGX540</d:gpu>
+ <d:abi>
+ armeabi
+ armeabi-v7a
+ </d:abi>
+ <!--dock (car, desk, tv, none)-->
+ <d:dock>
+ </d:dock>
+ <!-- plugged in (never, charge, always) -->
+ <d:plugged-in>charge</d:plugged-in>
+ </d:hardware>
+ <d:state name="Portrait" default="true">
+ <d:description>The phone in portrait view</d:description>
+ <d:screen-orientation>portrait</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ </d:device>
+</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml
new file mode 100644
index 0000000..c4955b4
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0"?>
+<d:devices
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:d="http://schemas.android.com/sdk/devices/1">
+
+ <d:device>
+ <d:name>
+ Galaxy Nexus
+ </d:name>
+ <d:manufacturer>
+ Samsung
+ </d:manufacturer>
+ <d:hardware>
+ <d:screen>
+ <d:screen-size>normal</d:screen-size>
+ <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
+ <d:pixel-density>xhdpi</d:pixel-density>
+ <d:screen-ratio>long</d:screen-ratio>
+ <d:dimensions>
+ <d:x-dimension>720</d:x-dimension>
+ <d:y-dimension>1280</d:y-dimension>
+ </d:dimensions>
+ <d:xdpi>316</d:xdpi>
+ <d:ydpi>316</d:ydpi>
+ <d:touch>
+ <d:multitouch>jazz-hands</d:multitouch>
+ <d:mechanism>finger</d:mechanism>
+ <d:screen-type>capacitive</d:screen-type>
+ </d:touch>
+ </d:screen>
+ <d:networking>
+ Bluetooth
+ Wifi
+ NFC
+ </d:networking>
+ <d:sensors>
+ Accelerometer
+ Barometer
+ Gyroscope
+ Compass
+ GPS
+ ProximitySensor
+ </d:sensors>
+ <d:mic>true</d:mic>
+ <d:camera>
+ <d:location>front</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>false</d:flash>
+ </d:camera>
+ <d:camera>
+ <d:location>back</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>true</d:flash>
+ </d:camera>
+ <d:keyboard>nokeys</d:keyboard>
+ <d:nav>nonav</d:nav>
+ <d:ram unit="GiB">1</d:ram>
+ <d:buttons>soft</d:buttons>
+ <d:internal-storage unit="GiB">16</d:internal-storage>
+ <d:removable-storage unit="KiB"></d:removable-storage>
+ <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
+ <d:gpu>PowerVR SGX540</d:gpu>
+ <d:abi>
+ armeabi
+ armeabi-v7a
+ </d:abi>
+ <!--dock (car, desk, tv, none)-->
+ <d:dock>
+ </d:dock>
+ <!-- plugged in (never, charge, always) -->
+ <d:plugged-in>charge</d:plugged-in>
+ </d:hardware>
+ <d:software>
+ <d:api-level>14</d:api-level>
+ <d:live-wallpaper-support>true</d:live-wallpaper-support>
+ <d:bluetooth-profiles>
+ HSP
+ HFP
+ SPP
+ A2DP
+ AVRCP
+ OPP
+ PBAP
+ GAVDP
+ AVDTP
+ HID
+ HDP
+ PAN
+ </d:bluetooth-profiles>
+ <d:gl-version>2.0</d:gl-version>
+ <!--
+ These can be gotten via
+ javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
+ -->
+ <d:gl-extensions>
+ GL_EXT_discard_framebuffer
+ GL_EXT_multi_draw_arrays
+ GL_EXT_shader_texture_lod
+ GL_EXT_texture_format_BGRA8888
+ GL_IMG_multisampled_render_to_texture
+ GL_IMG_program_binary
+ GL_IMG_read_format
+ GL_IMG_shader_binary
+ GL_IMG_texture_compression_pvrtc
+ GL_IMG_texture_format_BGRA8888
+ GL_IMG_texture_npot
+ GL_OES_compressed_ETC1_RGB8_texture
+ GL_OES_depth_texture
+ GL_OES_depth24
+ GL_OES_EGL_image
+ GL_OES_EGL_image_external
+ GL_OES_egl_sync
+ GL_OES_element_index_uint
+ GL_OES_fragment_precision_high
+ GL_OES_get_program_binary
+ GL_OES_mapbuffer
+ GL_OES_packed_depth_stencil
+ GL_OES_required_internalformat
+ GL_OES_rgb8_rgba8
+ GL_OES_standard_derivatives
+ GL_OES_texture_float
+ GL_OES_texture_half_float
+ GL_OES_vertex_array_object
+ GL_OES_vertex_half_float
+ </d:gl-extensions>
+ </d:software>
+ </d:device>
+</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml
new file mode 100644
index 0000000..a4e464c
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml
@@ -0,0 +1,140 @@
+<?xml version="1.0"?>
+<d:devices
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:d="http://schemas.android.com/sdk/devices/1">
+
+ <d:device>
+ <d:name>
+ Galaxy Nexus
+ </d:name>
+ <d:manufacturer>
+ Samsung
+ </d:manufacturer>
+ <d:hardware>
+ <d:screen>
+ <d:screen-size>normal</d:screen-size>
+ <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
+ <d:pixel-density>xhdpi</d:pixel-density>
+ <d:screen-ratio>long</d:screen-ratio>
+ <d:dimensions>
+ <d:x-dimension>720</d:x-dimension>
+ <d:y-dimension>1280</d:y-dimension>
+ </d:dimensions>
+ <d:xdpi>316</d:xdpi>
+ <d:ydpi>316</d:ydpi>
+ <d:touch>
+ <d:multitouch>jazz-hands</d:multitouch>
+ <d:mechanism>finger</d:mechanism>
+ <d:screen-type>capacitive</d:screen-type>
+ </d:touch>
+ </d:screen>
+ <d:networking>
+ Bluetooth
+ Wifi
+ NFC
+ </d:networking>
+ <d:sensors>
+ Accelerometer
+ Barometer
+ Gyroscope
+ Compass
+ GPS
+ ProximitySensor
+ </d:sensors>
+ <d:mic>true</d:mic>
+ <d:camera>
+ <d:location>front</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>false</d:flash>
+ </d:camera>
+ <d:camera>
+ <d:location>back</d:location>
+ <d:autofocus>true</d:autofocus>
+ <d:flash>true</d:flash>
+ </d:camera>
+ <d:keyboard>nokeys</d:keyboard>
+ <d:nav>nonav</d:nav>
+ <d:ram unit="GiB">1</d:ram>
+ <d:buttons>soft</d:buttons>
+ <d:internal-storage unit="GiB">16</d:internal-storage>
+ <d:removable-storage unit="KiB"></d:removable-storage>
+ <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
+ <d:gpu>PowerVR SGX540</d:gpu>
+ <d:abi>
+ armeabi
+ armeabi-v7a
+ </d:abi>
+ <!--dock (car, desk, tv, none)-->
+ <d:dock>
+ </d:dock>
+ <!-- plugged in (never, charge, always) -->
+ <d:plugged-in>charge</d:plugged-in>
+ </d:hardware>
+ <d:software>
+ <d:api-level>14</d:api-level>
+ <d:live-wallpaper-support>true</d:live-wallpaper-support>
+ <d:bluetooth-profiles>
+ HSP
+ HFP
+ SPP
+ A2DP
+ AVRCP
+ OPP
+ PBAP
+ GAVDP
+ AVDTP
+ HID
+ HDP
+ PAN
+ </d:bluetooth-profiles>
+ <d:gl-version>2.0</d:gl-version>
+ <!--
+ These can be gotten via
+ javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
+ -->
+ <d:gl-extensions>
+ GL_EXT_discard_framebuffer
+ GL_EXT_multi_draw_arrays
+ GL_EXT_shader_texture_lod
+ GL_EXT_texture_format_BGRA8888
+ GL_IMG_multisampled_render_to_texture
+ GL_IMG_program_binary
+ GL_IMG_read_format
+ GL_IMG_shader_binary
+ GL_IMG_texture_compression_pvrtc
+ GL_IMG_texture_format_BGRA8888
+ GL_IMG_texture_npot
+ GL_OES_compressed_ETC1_RGB8_texture
+ GL_OES_depth_texture
+ GL_OES_depth24
+ GL_OES_EGL_image
+ GL_OES_EGL_image_external
+ GL_OES_egl_sync
+ GL_OES_element_index_uint
+ GL_OES_fragment_precision_high
+ GL_OES_get_program_binary
+ GL_OES_mapbuffer
+ GL_OES_packed_depth_stencil
+ GL_OES_required_internalformat
+ GL_OES_rgb8_rgba8
+ GL_OES_standard_derivatives
+ GL_OES_texture_float
+ GL_OES_texture_half_float
+ GL_OES_vertex_array_object
+ GL_OES_vertex_half_float
+ </d:gl-extensions>
+ </d:software>
+ <d:state name="Portrait" default="true">
+ <d:description>The phone in portrait view</d:description>
+ <d:screen-orientation>portrait</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ <d:state name="Landscape" default="true">
+ <d:description>The phone in landscape view</d:description>
+ <d:screen-orientation>landscape</d:screen-orientation>
+ <d:keyboard-state>keyssoft</d:keyboard-state>
+ <d:nav-state>nonav</d:nav-state>
+ </d:state>
+ </d:device>
+</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.jpeg b/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.jpeg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.jpeg
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.png b/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.png
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.png
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.jpeg b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.jpeg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.jpeg
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.png b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.png
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.png
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.jpeg b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.jpeg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.jpeg
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.png b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.png
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.png