Commit 0216c9f8 authored by sky's avatar sky Committed by Commit bot

Fixes viewmanager tests on android

There were two things causing flake:
. The bounds of the root asynchronously changes.
. Similarly the metrics are asynchronously available.
As tests expect certain things to happen in a certain order these were
causing problems.
As we don't care about these cases I've ignored tracking them. This
makes the test cleanly pass now.

I also added --repeat-count to the apptest_runner.

BUG=497920
TEST=test only change
R=msw@chromium.org

Review URL: https://codereview.chromium.org/1174993002

Cr-Commit-Position: refs/heads/master@{#333793}
parent 984f7796
......@@ -22,6 +22,8 @@ def main():
help="a file listing apptests to run")
parser.add_argument("build_dir", type=str, help="the build output directory")
parser.add_argument("--verbose", default=False, action='store_true')
parser.add_argument('--repeat_count', default=1, metavar='INT',
action='store', type=int)
parser.add_argument('--write-full-results-to', metavar='FILENAME',
help='Path to write the JSON list of full results.')
args = parser.parse_args()
......@@ -50,23 +52,27 @@ def main():
tests = []
passed = []
failed = []
for test_dict in test_list:
test = test_dict["test"]
test_name = test_dict.get("name", test)
test_type = test_dict.get("type", "gtest")
test_args = test_dict.get("args", [])
print "Running %s...%s" % (test_name, ("\n" if args.verbose else "")),
sys.stdout.flush()
tests.append(test_name)
assert test_type in ("gtest", "gtest_isolated")
isolate = test_type == "gtest_isolated"
result = gtest.run_apptest(config, shell, test_args, test, isolate)
passed.extend([test_name] if result else [])
failed.extend([] if result else [test_name])
print "[ PASSED ]" if result else "[ FAILED ]",
print test_name if args.verbose or not result else ""
for _ in range(args.repeat_count):
for test_dict in test_list:
test = test_dict["test"]
test_name = test_dict.get("name", test)
test_type = test_dict.get("type", "gtest")
test_args = test_dict.get("args", [])
print "Running %s...%s" % (test_name, ("\n" if args.verbose else "")),
sys.stdout.flush()
tests.append(test_name)
assert test_type in ("gtest", "gtest_isolated")
isolate = test_type == "gtest_isolated"
result = gtest.run_apptest(config, shell, test_args, test, isolate)
passed.extend([test_name] if result else [])
failed.extend([] if result else [test_name])
print "[ PASSED ]" if result else "[ FAILED ]",
print test_name if args.verbose or not result else ""
if failed:
break;
print "[ PASSED ] %d apptests" % len(passed),
print ": %s" % ", ".join(passed) if passed else ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment