示例#1
0
    def BuildRemotePlatformOptions(self):
        if self.device or self.android_blacklist_file:
            self.remote_platform_options = (
                remote_platform_options.AndroidPlatformOptions(
                    self.device, self.android_blacklist_file))

            # We delete these options because they should live solely in the
            # AndroidPlatformOptions instance belonging to this class.
            if self.device:
                del self.device
            if self.android_blacklist_file:
                del self.android_blacklist_file
        else:
            self.remote_platform_options = (
                remote_platform_options.AndroidPlatformOptions())
 def testAdbPickOneDeviceReturnsDeviceInstance(self):
   finder_options = browser_options.BrowserFinderOptions()
   platform_options = remote_platform_options.AndroidPlatformOptions(
       device='555d14fecddddddd')  # pick one
   finder_options.remote_platform_options = platform_options
   with mock.patch('os.path.isabs', return_value=False):
     self._healthy_device_mock.return_value = [
         self._GetMockDeviceUtils('015d14fec128220c'),
         self._GetMockDeviceUtils('555d14fecddddddd')]
     device = android_device.GetDevice(finder_options)
     self.assertEquals([], self._android_device_stub.logging.warnings)
     self.assertEquals('555d14fecddddddd', device.device_id)