Home
last modified time | relevance | path

Searched refs:parser (Results 1 – 25 of 126) sorted by relevance

123456

/cts/tests/tests/widget/src/android/widget/cts/util/
DXmlUtils.java48 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument
50 int outerDepth = parser.getDepth(); in skipCurrentTag()
52 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag()
54 || parser.getDepth() > outerDepth)) { in skipCurrentTag()
710 XmlPullParser parser = Xml.newPullParser(); in readMapXml() local
711 parser.setInput(in, StandardCharsets.UTF_8.name()); in readMapXml()
712 return (HashMap<String, ?>) readValueXml(parser, new String[1]); in readMapXml()
731 XmlPullParser parser = Xml.newPullParser(); in readListXml() local
732 parser.setInput(in, StandardCharsets.UTF_8.name()); in readListXml()
733 return (ArrayList)readValueXml(parser, new String[1]); in readListXml()
[all …]
/cts/tests/tests/view/src/android/view/cts/util/
DXmlUtils.java47 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument
49 int outerDepth = parser.getDepth(); in skipCurrentTag()
51 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag()
53 || parser.getDepth() > outerDepth)) { in skipCurrentTag()
709 XmlPullParser parser = Xml.newPullParser(); in readMapXml() local
710 parser.setInput(in, StandardCharsets.UTF_8.name()); in readMapXml()
711 return (HashMap<String, ?>) readValueXml(parser, new String[1]); in readMapXml()
730 XmlPullParser parser = Xml.newPullParser(); in readListXml() local
731 parser.setInput(in, StandardCharsets.UTF_8.name()); in readListXml()
732 return (ArrayList)readValueXml(parser, new String[1]); in readListXml()
[all …]
/cts/tests/tests/content/src/android/content/cts/util/
DXmlUtils.java50 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument
52 int outerDepth = parser.getDepth(); in skipCurrentTag()
54 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag()
56 || parser.getDepth() > outerDepth)) { in skipCurrentTag()
737 XmlPullParser parser = Xml.newPullParser(); in readMapXml() local
738 parser.setInput(in, StandardCharsets.UTF_8.name()); in readMapXml()
739 return (HashMap<String, ?>) readValueXml(parser, new String[1]); in readMapXml()
758 XmlPullParser parser = Xml.newPullParser(); in readListXml() local
759 parser.setInput(in, StandardCharsets.UTF_8.name()); in readListXml()
760 return (ArrayList)readValueXml(parser, new String[1]); in readListXml()
[all …]
/cts/tests/tests/graphics/src/android/graphics/drawable/cts/
DDrawableTestUtils.java33 public static void skipCurrentTag(XmlPullParser parser) in skipCurrentTag() argument
35 int outerDepth = parser.getDepth(); in skipCurrentTag()
37 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT in skipCurrentTag()
39 || parser.getDepth() > outerDepth)) { in skipCurrentTag()
52 public static AttributeSet getAttributeSet(XmlResourceParser parser, String searchedNodeName) in getAttributeSet() argument
56 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttributeSet()
59 String nodeName = parser.getName(); in getAttributeSet()
63 int outerDepth = parser.getDepth(); in getAttributeSet()
64 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttributeSet()
65 && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { in getAttributeSet()
[all …]
DPaintDrawableTest.java105 XmlResourceParser parser = getParser(); in testInflateTag() local
106 AttributeSet attr = getAtrributeSet(parser); in testInflateTag()
108 gotoTag(parser, "padding"); in testInflateTag()
117 assertTrue(paintDrawable.inflateTag("padding", getContext().getResources(), parser, attr)); in testInflateTag()
121 parser = getParser(); in testInflateTag()
122 attr = getAtrributeSet(parser); in testInflateTag()
124 assertFalse(new MyPaintDrawable().inflateTag("", getContext().getResources(), parser, in testInflateTag()
130 new MyPaintDrawable().inflateTag(null, getContext().getResources(), parser, attr); in testInflateTag()
138 gotoTag(parser, "padding"); in testInflateTag()
139 new MyPaintDrawable().inflateTag("padding", null, parser, attr); in testInflateTag()
[all …]
DLevelListDrawableTest.java113 XmlResourceParser parser = getResourceParser(R.xml.level_list_correct); in testInflate() local
116 mLevelListDrawable.inflate(mResources, parser, Xml.asAttributeSet(parser)); in testInflate()
128 parser = getResourceParser(R.xml.level_list_missing_item_minlevel_maxlevel); in testInflate()
129 mLevelListDrawable.inflate(mResources, parser, Xml.asAttributeSet(parser)); in testInflate()
137 parser = getResourceParser(R.xml.level_list_missing_item_drawable); in testInflate()
139 mLevelListDrawable.inflate(mResources, parser, Xml.asAttributeSet(parser)); in testInflate()
146 XmlResourceParser parser = getResourceParser(R.xml.level_list_correct); in testInflateWithNullParameters() local
148 mLevelListDrawable.inflate(null, parser, Xml.asAttributeSet(parser)); in testInflateWithNullParameters()
154 mLevelListDrawable.inflate(mResources, null, Xml.asAttributeSet(parser)); in testInflateWithNullParameters()
160 mLevelListDrawable.inflate(mResources, parser, null); in testInflateWithNullParameters()
[all …]
DStateListDrawableTest.java157 XmlResourceParser parser = getResourceParser(R.xml.selector_correct); in testInflate() local
160 mStateListDrawable.inflate(mResources, parser, Xml.asAttributeSet(parser)); in testInflate()
180 parser = getResourceParser(R.xml.selector_missing_selector_attrs); in testInflate()
181 mStateListDrawable.inflate(mResources, parser, Xml.asAttributeSet(parser)); in testInflate()
197 parser = getResourceParser(R.xml.selector_missing_item_drawable); in testInflate()
199 mStateListDrawable.inflate(mResources, parser, Xml.asAttributeSet(parser)); in testInflate()
206 XmlResourceParser parser = getResourceParser(R.xml.level_list_correct); in testInflateWithNullParameters() local
208 mStateListDrawable.inflate(null, parser, Xml.asAttributeSet(parser)); in testInflateWithNullParameters()
214 mStateListDrawable.inflate(mResources, null, Xml.asAttributeSet(parser)); in testInflateWithNullParameters()
220 mStateListDrawable.inflate(mResources, parser, null); in testInflateWithNullParameters()
[all …]
DAnimationDrawableTest.java281 XmlResourceParser parser = getResourceParser(R.xml.anim_list_correct); in testInflateCorrect() local
283 dr.inflate(mResources, parser, Xml.asAttributeSet(parser)); in testInflateCorrect()
299 XmlResourceParser parser = getResourceParser(R.xml.anim_list_missing_item_drawable); in testInflateMissingDrawable() local
302 dr.inflate(mResources, parser, Xml.asAttributeSet(parser)); in testInflateMissingDrawable()
310 XmlResourceParser parser = getResourceParser(R.drawable.animationdrawable); in testInflateNullResources() local
313 dr.inflate(null, parser, Xml.asAttributeSet(parser)); in testInflateNullResources()
321 XmlResourceParser parser = getResourceParser(R.drawable.animationdrawable); in testInflateNullXmlPullParser() local
324 dr.inflate(mResources, null, Xml.asAttributeSet(parser)); in testInflateNullXmlPullParser()
332 XmlResourceParser parser = getResourceParser(R.drawable.animationdrawable); in testInflateNullAttributeSet() local
335 dr.inflate(mResources, parser, null); in testInflateNullAttributeSet()
[all …]
/cts/tests/signature/src/android/signature/cts/
DSignatureTest.java125 private void beginDocument(XmlPullParser parser, String firstElementName) in beginDocument() argument
128 while ((type=parser.next()) != XmlPullParser.START_TAG in beginDocument()
135 if (!parser.getName().equals(firstElementName)) { in beginDocument()
136 throw new XmlPullParserException("Unexpected start tag: found " + parser.getName() + in beginDocument()
144 private void start(XmlPullParser parser) throws XmlPullParserException, IOException { in start() argument
145 logd(String.format("Name: %s", parser.getName())); in start()
146 logd(String.format("Text: %s", parser.getText())); in start()
147 logd(String.format("Namespace: %s", parser.getNamespace())); in start()
148 logd(String.format("Line Number: %s", parser.getLineNumber())); in start()
149 logd(String.format("Column Number: %s", parser.getColumnNumber())); in start()
[all …]
/cts/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/
DTestPackageXmlParserTest.java97 TestPackageXmlParser parser = new TestPackageXmlParser(true); in testParse_instrPackage() local
98 parser.parse(getStringAsStream(INSTR_TEST_DATA)); in testParse_instrPackage()
99 for (TestPackageDef def : parser.getTestPackageDefs()) { in testParse_instrPackage()
111 TestPackageXmlParser parser = new TestPackageXmlParser(true); in testParse_hostTest() local
112 parser.parse(getStringAsStream(HOST_TEST_DATA)); in testParse_hostTest()
113 for (TestPackageDef def : parser.getTestPackageDefs()) { in testParse_hostTest()
135 TestPackageXmlParser parser = new TestPackageXmlParser(false); in testParse_hostTest_noKnownFailures() local
136 parser.parse(getStringAsStream(HOST_TEST_DATA)); in testParse_hostTest_noKnownFailures()
137 for (TestPackageDef def : parser.getTestPackageDefs()) { in testParse_hostTest_noKnownFailures()
158 TestPackageXmlParser parser = new TestPackageXmlParser(true); in testParse_badHostTest() local
[all …]
/cts/tools/tradefed-host/src/com/android/cts/tradefed/result/
DTestSummaryXml.java103 void parse(XmlPullParser parser) throws XmlPullParserException, IOException { in parse() argument
104 int eventType = parser.getEventType(); in parse()
106 if (eventType == XmlPullParser.START_TAG && parser.getName().equals( in parse()
108 mPlan = getAttribute(parser, CtsXmlResultReporter.PLAN_ATTR); in parse()
109 mStartTime = getAttribute(parser, CtsXmlResultReporter.STARTTIME_ATTR); in parse()
110 } else if (eventType == XmlPullParser.START_TAG && parser.getName().equals( in parse()
112 mDeviceSerials = getAttribute(parser, DeviceInfoConstants.SERIAL_NUMBER); in parse()
113 } else if (eventType == XmlPullParser.START_TAG && parser.getName().equals( in parse()
115 mNumFailed = parseIntAttr(parser, TestResults.FAILED_ATTR) + in parse()
116 parseIntAttr(parser, TestResults.TIMEOUT_ATTR); in parse()
[all …]
DAbstractXmlPullParser.java44 XmlPullParser parser = fact.newPullParser(); in parse() local
45 parser.setInput (xmlReader); in parse()
46 parse(parser); in parse()
54 abstract void parse(XmlPullParser parser) throws XmlPullParserException, IOException; in parse() argument
63 protected int parseIntAttr(XmlPullParser parser, String name) { in parseIntAttr() argument
65 String value = parser.getAttributeValue(null, name); in parseIntAttr()
78 protected boolean parseBooleanAttr(XmlPullParser parser, String name) { in parseBooleanAttr() argument
79 String stringValue = parser.getAttributeValue(null, name); in parseBooleanAttr()
91 protected String getAttribute(XmlPullParser parser, String name) { in getAttribute() argument
92 return parser.getAttributeValue(null, name); in getAttribute()
DDeviceInfoResult.java227 void parse(XmlPullParser parser) throws XmlPullParserException, IOException { in parse() argument
228 if (!parser.getName().equals(TAG)) { in parse()
230 "invalid XML: Expected %s tag but received %s", TAG, parser.getName())); in parse()
232 int eventType = parser.getEventType(); in parse()
235 if (parser.getName().equals(SCREEN_TAG) || in parse()
236 parser.getName().equals(PHONE_TAG) || in parse()
237 parser.getName().equals(BUILD_TAG)) { in parse()
238 addMetricsFromAttributes(parser); in parse()
239 } else if (parser.getName().equals(FEATURE_INFO_TAG)) { in parse()
240 mMetrics.put(DeviceInfoConstants.FEATURES, parseFeatures(parser)); in parse()
[all …]
DTestCase.java106 void parse(XmlPullParser parser) throws XmlPullParserException, IOException { in parse() argument
107 if (!parser.getName().equals(TAG)) { in parse()
109 "invalid XML: Expected %s tag but received %s", TAG, parser.getName())); in parse()
111 setName(getAttribute(parser, "name")); in parse()
112 int eventType = parser.next(); in parse()
114 if (eventType == XmlPullParser.START_TAG && parser.getName().equals(Test.TAG)) { in parse()
116 test.parse(parser); in parse()
118 } else if (eventType == XmlPullParser.END_TAG && parser.getName().equals(TAG)) { in parse()
121 eventType = parser.next(); in parse()
DTestSuite.java161 void parse(XmlPullParser parser) throws XmlPullParserException, IOException { in parse() argument
162 if (!parser.getName().equals(TAG)) { in parse()
164 "invalid XML: Expected %s tag but received %s", TAG, parser.getName())); in parse()
166 setName(getAttribute(parser, "name")); in parse()
167 int eventType = parser.next(); in parse()
169 if (eventType == XmlPullParser.START_TAG && parser.getName().equals(TestSuite.TAG)) { in parse()
171 suite.parse(parser); in parse()
173 } else if (eventType == XmlPullParser.START_TAG && parser.getName().equals( in parse()
176 testCase.parse(parser); in parse()
178 } else if (eventType == XmlPullParser.END_TAG && parser.getName().equals(TAG)) { in parse()
[all …]
DTest.java333 void parse(XmlPullParser parser) throws XmlPullParserException, IOException { in parse() argument
334 if (!parser.getName().equals(TAG)) { in parse()
336 "invalid XML: Expected %s tag but received %s", TAG, parser.getName())); in parse()
338 setName(getAttribute(parser, NAME_ATTR)); in parse()
339 mResult = CtsTestStatus.getStatus(getAttribute(parser, RESULT_ATTR)); in parse()
340 mStartTime = getAttribute(parser, STARTTIME_ATTR); in parse()
341 mEndTime = getAttribute(parser, ENDTIME_ATTR); in parse()
343 int eventType = parser.next(); in parse()
345 if (eventType == XmlPullParser.START_TAG && parser.getName().equals(SCENE_TAG)) { in parse()
346 mMessage = getAttribute(parser, MESSAGE_ATTR); in parse()
[all …]
DTestPackageResult.java194 void parse(XmlPullParser parser) throws XmlPullParserException, IOException { in parse() argument
195 if (!parser.getName().equals(TAG)) { in parse()
197 "invalid XML: Expected %s tag but received %s", TAG, parser.getName())); in parse()
199 setAppPackageName(getAttribute(parser, APP_PACKAGE_NAME_ATTR)); in parse()
200 setName(getAttribute(parser, NAME_ATTR)); in parse()
201 setAbi(getAttribute(parser, ABI_ATTR)); in parse()
202 setDigest(getAttribute(parser, DIGEST_ATTR)); in parse()
203 int eventType = parser.getEventType(); in parse()
205 if (eventType == XmlPullParser.START_TAG && parser.getName().equals(TestSuite.TAG)) { in parse()
207 suite.parse(parser); in parse()
[all …]
/cts/tools/tradefed-host/tests/src/com/android/cts/tradefed/result/
DTestResultsTest.java55 TestResults parser = new TestResults(); in testParse_empty() local
56 parser.parse(new StringReader("<Empty/>")); in testParse_empty()
57 assertEquals(0, parser.getPackages().size()); in testParse_empty()
64 TestResults parser = new TestResults(); in testParse_package() local
65 parser.parse(new StringReader(TEST_PACKAGE_FULL)); in testParse_package()
66 assertEquals(1, parser.getPackages().size()); in testParse_package()
67 TestPackageResult pkg = parser.getPackages().iterator().next(); in testParse_package()
77 TestResults parser = new TestResults(); in testParse_corrupt() local
80 parser.parse(new StringReader(RESULT_START + TEST_PACKAGE_START + RESULT_END)); in testParse_corrupt()
91 TestResults parser = new TestResults(); in testParse_test() local
[all …]
/cts/tests/tests/widget/src/android/widget/cts/
DSwitchTest.java41 XmlResourceParser parser = mContext.getResources().getLayout(R.layout.switch_layout); in testConstructor() local
42 WidgetTestUtils.beginDocument(parser, "Switch"); in testConstructor()
44 new Switch(mContext, parser); in testConstructor()
46 new Switch(mContext, parser, 0); in testConstructor()
48 new Switch(mContext, parser, 0, 0); in testConstructor()
52 XmlResourceParser parser = mContext.getResources().getLayout(R.layout.switch_layout); in testAccessThumbTint() local
53 WidgetTestUtils.beginDocument(parser, "Switch"); in testAccessThumbTint()
54 Switch aSwitch = new Switch(mContext, parser); in testAccessThumbTint()
67 XmlResourceParser parser = mContext.getResources().getLayout(R.layout.switch_layout); in testAccessTrackTint() local
68 WidgetTestUtils.beginDocument(parser, "Switch"); in testAccessTrackTint()
[all …]
DTableLayout_LayoutParamsTest.java140 XmlResourceParser parser = null; in getAttrs() local
143 parser = mTargetContext.getResources().getXml(R.xml.base_attributes); in getAttrs()
146 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttrs()
149 String nodeName = parser.getName(); in getAttrs()
153 int outerDepth = parser.getDepth(); in getAttrs()
154 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttrs()
155 && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { in getAttrs()
159 nodeName = parser.getName(); in getAttrs()
161 outerDepth = parser.getDepth(); in getAttrs()
162 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttrs()
[all …]
DTableRow_LayoutParamsTest.java186 XmlResourceParser parser = null; in getAttrs() local
189 parser = mTargetContext.getResources().getXml(R.xml.base_attributes); in getAttrs()
192 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttrs()
195 String nodeName = parser.getName(); in getAttrs()
199 int outerDepth = parser.getDepth(); in getAttrs()
200 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttrs()
201 && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { in getAttrs()
205 nodeName = parser.getName(); in getAttrs()
207 outerDepth = parser.getDepth(); in getAttrs()
208 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttrs()
[all …]
/cts/tests/tests/view/src/android/view/cts/
DLayoutInflaterTest.java98 XmlResourceParser parser = null; in getAttrs() local
106 parser = ai.loadXmlMetaData(mContext.getPackageManager(), in getAttrs()
109 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttrs()
112 String nodeName = parser.getName(); in getAttrs()
116 int outerDepth = parser.getDepth(); in getAttrs()
117 while ((type = parser.next()) != XmlPullParser.END_DOCUMENT in getAttrs()
118 && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { in getAttrs()
122 nodeName = parser.getName(); in getAttrs()
124 attrs = Xml.asAttributeSet(parser); in getAttrs()
126 XmlUtils.skipCurrentTag(parser); in getAttrs()
[all …]
/cts/tools/signature-tools/test/signature/converter/dex/
DGenericSignatureParserTest.java42 private GenericSignatureParser parser; field in GenericSignatureParserTest
48 parser = new GenericSignatureParser(new TypePool(), converter); in setupConverter()
58 parser.parseForClass(sigClass, DexUtil.getGenericSignature(dexClass)); in getGenericSignatureTest()
60 assertEquals(1, parser.formalTypeParameters.size()); in getGenericSignatureTest()
61 assertEquals("T", parser.formalTypeParameters.get(0).getName()); in getGenericSignatureTest()
63 assertSame(sigClass, parser.formalTypeParameters.get(0).getGenericDeclaration()); in getGenericSignatureTest()
65 assertEquals(1, parser.formalTypeParameters.get(0).getUpperBounds().size()); in getGenericSignatureTest()
/cts/tests/tests/content/src/android/content/res/cts/
DAssetManagerTest.java69 XmlResourceParser parser = mAssets.openXmlResourceParser("AndroidManifest.xml"); in testAssetOperations() local
70 assertNotNull(parser); in testAssetOperations()
71 XmlUtils.beginDocument(parser, "manifest"); in testAssetOperations()
72 parser = mAssets.openXmlResourceParser(0, "AndroidManifest.xml"); in testAssetOperations()
73 assertNotNull(parser); in testAssetOperations()
74 beginDocument(parser, "manifest"); in testAssetOperations()
127 private void beginDocument(final XmlPullParser parser,final String firstElementName) in beginDocument() argument
130 while ((type = parser.next()) != XmlPullParser.START_TAG) { in beginDocument()
135 assertEquals(firstElementName, parser.getName()); in beginDocument()
/cts/libs/deviceutil/src/android/cts/util/
DWidgetTestUtils.java80 public static final void beginDocument(XmlPullParser parser, String firstElementName) in beginDocument() argument
82 Assert.assertNotNull(parser); in beginDocument()
86 while ((type = parser.next()) != XmlPullParser.START_TAG in beginDocument()
91 if (!parser.getName().equals(firstElementName)) { in beginDocument()
92 throw new XmlPullParserException("Unexpected start tag: found " + parser.getName() in beginDocument()

123456