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

Unified Diff: devil/devil/android/apk_helper_test.py

Issue 3000783002: Revert of ApkHelper: Add GetViewActivityName(). Make GetActivityName() more strict (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « devil/devil/android/apk_helper.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devil/devil/android/apk_helper_test.py
diff --git a/devil/devil/android/apk_helper_test.py b/devil/devil/android/apk_helper_test.py
index b8f2d7e80c12c5e71a23783b08b3dbee38c249c4..f7d077dd62570b5ce915a5ceca9f841f58bae5df 100755
--- a/devil/devil/android/apk_helper_test.py
+++ b/devil/devil/android/apk_helper_test.py
@@ -2,8 +2,6 @@
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-
-import unittest
from devil import base_error
from devil import devil_env
@@ -31,27 +29,6 @@
E: service (line=7)
A: android:name(0x01010001)="org.chromium.RandomService" (Raw: "org.chromium.RandomService")
A: android:isolatedProcess(0x01010888)=(type 0x12)0xffffffff
- E: activity (line=173)
- A: android:name(0x01010003)=".MainActivity" (Raw: ".MainActivity")
- A: android:exported(0x01010010)=(type 0x12)0xffffffff
- E: intent-filter (line=177)
- E: action (line=178)
- A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
- E: category (line=180)
- A: android:name(0x01010003)="android.intent.category.DEFAULT" (Raw: "android.intent.category.DEFAULT")
- E: category (line=181)
- A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
- E: activity-alias (line=173)
- A: android:name(0x01010003)="org.chromium.ViewActivity" (Raw: "org.chromium.ViewActivity")
- A: android:exported(0x01010010)=(type 0x12)0xffffffff
- A: android:targetActivity(0x01010202)="org.chromium.ActivityName" (Raw: "org.chromium.ActivityName")
- E: intent-filter (line=191)
- E: action (line=192)
- A: android:name(0x01010003)="android.intent.action.VIEW" (Raw: "android.intent.action.VIEW")
- E: data (line=198)
- A: android:scheme(0x01010027)="http" (Raw: "http")
- E: data (line=199)
- A: android:scheme(0x01010027)="https" (Raw: "https")
E: instrumentation (line=8)
A: android:label(0x01010001)="abc" (Raw: "abc")
A: android:name(0x01010003)="org.chromium.RandomJUnit4TestRunner" (Raw: "org.chromium.RandomJUnit4TestRunner")
@@ -117,25 +94,19 @@
def testGetInstrumentationName(self):
with _MockAaptDump(_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
with self.assertRaises(base_error.BaseError):
helper.GetInstrumentationName()
def testGetActivityName(self):
with _MockAaptDump(_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertEquals(
- helper.GetActivityName(), 'org.chromium.abc.MainActivity')
-
- def testGetViewActivityName(self):
- with _MockAaptDump(_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
- self.assertEquals(
- helper.GetViewActivityName(), 'org.chromium.ViewActivity')
+ helper.GetActivityName(), 'org.chromium.ActivityName')
def testGetAllInstrumentations(self):
with _MockAaptDump(_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
all_instrumentations = helper.GetAllInstrumentations()
self.assertEquals(len(all_instrumentations), 2)
self.assertEquals(all_instrumentations[0]['android:name'],
@@ -145,12 +116,12 @@
def testGetPackageName(self):
with _MockAaptDump(_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertEquals(helper.GetPackageName(), 'org.chromium.abc')
def testGetPermssions(self):
with _MockAaptDump(_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
all_permissions = helper.GetPermissions()
self.assertEquals(len(all_permissions), 3)
self.assertTrue('android.permission.INTERNET' in all_permissions)
@@ -161,41 +132,38 @@
def testGetSplitName(self):
with _MockAaptDump(_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertEquals(helper.GetSplitName(), 'random_split')
def testHasIsolatedProcesses_noApplication(self):
with _MockAaptDump(_NO_APPLICATION):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertFalse(helper.HasIsolatedProcesses())
def testHasIsolatedProcesses_noServices(self):
with _MockAaptDump(_NO_SERVICES):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertFalse(helper.HasIsolatedProcesses())
def testHasIsolatedProcesses_oneNotIsolatedProcess(self):
with _MockAaptDump(_NO_ISOLATED_SERVICES):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertFalse(helper.HasIsolatedProcesses())
def testHasIsolatedProcesses_oneIsolatedProcess(self):
with _MockAaptDump(_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertTrue(helper.HasIsolatedProcesses())
def testGetSingleInstrumentationName(self):
with _MockAaptDump(_SINGLE_INSTRUMENTATION_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertEquals('org.chromium.RandomTestRunner',
helper.GetInstrumentationName())
def testGetSingleJUnit4InstrumentationName(self):
with _MockAaptDump(_SINGLE_J4_INSTRUMENTATION_MANIFEST_DUMP):
- helper = apk_helper.ApkHelper('')
+ helper = apk_helper.ApkHelper("")
self.assertEquals('org.chromium.RandomJ4TestRunner',
helper.GetInstrumentationName())
-
-if __name__ == '__main__':
- unittest.main(verbosity=2)
« no previous file with comments | « devil/devil/android/apk_helper.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698