Beispiel #1
0
    def LaunchAndroidApplication(self,
                                 start_intent,
                                 is_app_ready_predicate=None,
                                 app_has_webviews=True):
        """Launches an Android application given the intent.

    Args:
      start_intent: The intent to use to start the app.
      is_app_ready_predicate: A predicate function to determine
          whether the app is ready. This is a function that takes an
          AndroidApp instance and return a boolean. When it is not passed in,
          the app is ready when the intent to launch it is completed.
      app_has_webviews: A boolean indicating whether the app is expected to
          contain any WebViews. If True, the app will be launched with
          appropriate webview flags, and the GetWebViews method of the returned
          object may be used to access them.

    Returns:
      A reference to the android_app launched.
    """
        self._platform_backend.DismissCrashDialogIfNeeded()
        app_backend = android_app_backend.AndroidAppBackend(
            self._platform_backend, start_intent, is_app_ready_predicate,
            app_has_webviews)
        return android_app.AndroidApp(app_backend, self._platform_backend)
Beispiel #2
0
 def setUp(self):
     self.platform_backend = mock.Mock()
     self.start_intent = intent_module.Intent(
         package='com.example.my_app',
         activity='com.example.my_app.LaunchMyApp')
     self.app_backend = android_app_backend.AndroidAppBackend(
         self.platform_backend, self.start_intent)
Beispiel #3
0
 def CreateAndroidApp(self, start_intent):
     platform = platform_module.GetPlatformForDevice(
         self._device, self._options)
     platform_backend = platform._platform_backend
     app_backend = android_app_backend.AndroidAppBackend(
         platform_backend, start_intent)
     return android_app.AndroidApp(app_backend, platform_backend)
Beispiel #4
0
  def LaunchAndroidApplication(self, start_intent, is_app_ready_predicate=None):
    """Launches an Android application given the intent.

    Args:
      start_intent: The intent to use to start the app.
      is_app_ready_predicate: A predicate function to determine
          whether the app is ready. This is a function that takes an
          AndroidApp instance and return a boolean. When it is not passed in,
          the app is ready by default.
    """
    self._platform_backend.DismissCrashDialogIfNeeded()
    app_backend = android_app_backend.AndroidAppBackend(
        self._platform_backend, start_intent, is_app_ready_predicate)
    return android_app.AndroidApp(app_backend, self._platform_backend)