OLD | NEW |
1 #! /usr/bin/env python | 1 #! /usr/bin/env python |
2 # Copyright 2017 The Chromium Authors. All rights reserved. | 2 # Copyright 2017 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import unittest | 6 import unittest |
7 | 7 |
8 from devil import base_error | 8 from devil import base_error |
9 from devil import devil_env | 9 from devil import devil_env |
10 from devil.android import apk_helper | 10 from devil.android import apk_helper |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 E: activity-alias (line=173) | 43 E: activity-alias (line=173) |
44 A: android:name(0x01010003)="org.chromium.ViewActivity" (Raw: "org.chrom
ium.ViewActivity") | 44 A: android:name(0x01010003)="org.chromium.ViewActivity" (Raw: "org.chrom
ium.ViewActivity") |
45 A: android:targetActivity(0x01010202)="org.chromium.ActivityName" (Raw:
"org.chromium.ActivityName") | 45 A: android:targetActivity(0x01010202)="org.chromium.ActivityName" (Raw:
"org.chromium.ActivityName") |
46 E: intent-filter (line=191) | 46 E: intent-filter (line=191) |
47 E: action (line=192) | 47 E: action (line=192) |
48 A: android:name(0x01010003)="android.intent.action.VIEW" (Raw: "andr
oid.intent.action.VIEW") | 48 A: android:name(0x01010003)="android.intent.action.VIEW" (Raw: "andr
oid.intent.action.VIEW") |
49 E: data (line=198) | 49 E: data (line=198) |
50 A: android:scheme(0x01010027)="http" (Raw: "http") | 50 A: android:scheme(0x01010027)="http" (Raw: "http") |
51 E: data (line=199) | 51 E: data (line=199) |
52 A: android:scheme(0x01010027)="https" (Raw: "https") | 52 A: android:scheme(0x01010027)="https" (Raw: "https") |
| 53 E: meta-data (line=43) |
| 54 A: android:name(0x01010003)="name1" (Raw: "name1") |
| 55 A: android:value(0x01010024)="value1" (Raw: "value1") |
| 56 E: meta-data (line=43) |
| 57 A: android:name(0x01010003)="name2" (Raw: "name2") |
| 58 A: android:value(0x01010024)="value2" (Raw: "value2") |
53 E: instrumentation (line=8) | 59 E: instrumentation (line=8) |
54 A: android:label(0x01010001)="abc" (Raw: "abc") | 60 A: android:label(0x01010001)="abc" (Raw: "abc") |
55 A: android:name(0x01010003)="org.chromium.RandomJUnit4TestRunner" (Raw: "o
rg.chromium.RandomJUnit4TestRunner") | 61 A: android:name(0x01010003)="org.chromium.RandomJUnit4TestRunner" (Raw: "o
rg.chromium.RandomJUnit4TestRunner") |
56 A: android:targetPackage(0x01010021)="org.chromium.random_package" (Raw:"o
rg.chromium.random_pacakge") | 62 A: android:targetPackage(0x01010021)="org.chromium.random_package" (Raw:"o
rg.chromium.random_pacakge") |
57 A: junit4=(type 0x12)0xffffffff (Raw: "true") | 63 A: junit4=(type 0x12)0xffffffff (Raw: "true") |
58 E: instrumentation (line=9) | 64 E: instrumentation (line=9) |
59 A: android:label(0x01010001)="abc" (Raw: "abc") | 65 A: android:label(0x01010001)="abc" (Raw: "abc") |
60 A: android:name(0x01010003)="org.chromium.RandomTestRunner" (Raw: "org.chr
omium.RandomTestRunner") | 66 A: android:name(0x01010003)="org.chromium.RandomTestRunner" (Raw: "org.chr
omium.RandomTestRunner") |
61 A: android:targetPackage(0x01010021)="org.chromium.random_package" (Raw:"o
rg.chromium.random_pacakge") | 67 A: android:targetPackage(0x01010021)="org.chromium.random_package" (Raw:"o
rg.chromium.random_pacakge") |
62 """ | 68 """ |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 helper = apk_helper.ApkHelper('') | 193 helper = apk_helper.ApkHelper('') |
188 self.assertEquals('org.chromium.RandomTestRunner', | 194 self.assertEquals('org.chromium.RandomTestRunner', |
189 helper.GetInstrumentationName()) | 195 helper.GetInstrumentationName()) |
190 | 196 |
191 def testGetSingleJUnit4InstrumentationName(self): | 197 def testGetSingleJUnit4InstrumentationName(self): |
192 with _MockAaptDump(_SINGLE_J4_INSTRUMENTATION_MANIFEST_DUMP): | 198 with _MockAaptDump(_SINGLE_J4_INSTRUMENTATION_MANIFEST_DUMP): |
193 helper = apk_helper.ApkHelper('') | 199 helper = apk_helper.ApkHelper('') |
194 self.assertEquals('org.chromium.RandomJ4TestRunner', | 200 self.assertEquals('org.chromium.RandomJ4TestRunner', |
195 helper.GetInstrumentationName()) | 201 helper.GetInstrumentationName()) |
196 | 202 |
| 203 def testGetAllMetadata(self): |
| 204 with _MockAaptDump(_MANIFEST_DUMP): |
| 205 helper = apk_helper.ApkHelper('') |
| 206 self.assertEquals([('name1', 'value1'), ('name2', 'value2')], |
| 207 helper.GetAllMetadata()) |
| 208 |
197 | 209 |
198 if __name__ == '__main__': | 210 if __name__ == '__main__': |
199 unittest.main(verbosity=2) | 211 unittest.main(verbosity=2) |
OLD | NEW |