| OLD | NEW |
| (Empty) |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 """Apptest runner specific to the particular Dart apptest framework in | |
| 6 /mojo/dart/apptests, built on top of the general apptest runner.""" | |
| 7 | |
| 8 import logging | |
| 9 | |
| 10 _logging = logging.getLogger() | |
| 11 | |
| 12 from pylib.apptest import run_apptest | |
| 13 | |
| 14 | |
| 15 def _dart_apptest_output_test(output): | |
| 16 # Fail on output with dart unittests' "FAIL:"/"ERROR:" or a lack of "PASS:". | |
| 17 # The latter condition ensures failure on broken command lines or output. | |
| 18 # Check output instead of exit codes because mojo_shell always exits with 0. | |
| 19 if (not output or | |
| 20 '\nFAIL: ' in output or | |
| 21 '\nERROR: ' in output or | |
| 22 '\nPASS: ' not in output): | |
| 23 return False | |
| 24 return True | |
| 25 | |
| 26 | |
| 27 # TODO(erg): Support android, launched services and fixture isolation. | |
| 28 def run_dart_apptest(shell, shell_args, apptest_url, apptest_args): | |
| 29 """Runs a dart apptest. | |
| 30 | |
| 31 Args: | |
| 32 shell_args: The arguments for mojo_shell. | |
| 33 apptest_url: Url of the apptest app to run. | |
| 34 apptest_args: Parameters to be passed to the apptest app. | |
| 35 | |
| 36 Returns: | |
| 37 True iff the test succeeded, False otherwise. | |
| 38 """ | |
| 39 return run_apptest(shell, shell_args, apptest_url, apptest_args, | |
| 40 _dart_apptest_output_test) | |
| OLD | NEW |