|
27 | 27 |
|
28 | 28 | from com.dtmilano.android.viewclient import * |
29 | 29 | from mocks import MockDevice |
30 | | -from mocks import DUMP, DUMP_SAMPLE_UI, VIEW_MAP, VIEW_MAP_API_8, RUNNING, STOPPED |
| 30 | +from mocks import DUMP, DUMP_SAMPLE_UI, VIEW_MAP, VIEW_MAP_API_8, RUNNING, STOPPED, WINDOWS |
31 | 31 |
|
32 | 32 | # this is probably the only reliable way of determining the OS in monkeyrunner |
33 | 33 | os_name = java.lang.System.getProperty('os.name') |
@@ -311,6 +311,13 @@ def __mockTree(self, dump=DUMP): |
311 | 311 | vc.setViews(dump) |
312 | 312 | return vc |
313 | 313 |
|
| 314 | + def __mockWindows(self, windows=WINDOWS): |
| 315 | + device = MockDevice() |
| 316 | + vc = ViewClient(device, serialno=device.serialno, adb=TRUE, autodump=False) |
| 317 | + self.assertNotEquals(None, vc) |
| 318 | + vc.windows = windows |
| 319 | + return vc |
| 320 | + |
314 | 321 | def testRoot(self): |
315 | 322 | vc = self.__mockTree() |
316 | 323 | root = vc.root |
@@ -444,6 +451,10 @@ def testServiceStoppedAfterDestructor(self): |
444 | 451 | # Perhpas there are other ViewClients using the same server, we cannot expect it stops |
445 | 452 | #self.assertTrue(device.service == STOPPED) |
446 | 453 |
|
| 454 | + def testList(self): |
| 455 | + vc = self.__mockWindows() |
| 456 | + self.assertNotEqual(None, vc.windows) |
| 457 | + |
447 | 458 | def testFindViewByIdOrRaise(self): |
448 | 459 | vc = self.__mockTree(dump=DUMP_SAMPLE_UI) |
449 | 460 | vc.findViewByIdOrRaise('id/up') |
|
0 commit comments