1# Copyright 2016 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5 6class TestException(Exception): 7 """Base class for exceptions thrown by the test runner.""" 8 9 10class InvalidShardingSettings(TestException): 11 def __init__(self, shard_index, total_shards): 12 super().__init__( 13 'Invalid sharding settings. shard_index: %d total_shards: %d' % 14 (shard_index, total_shards)) 15 16 17class InstallationError(TestException): 18 """When installation of apk, apex, etc., has any error.""" 19 20 21class InstallationFailedError(InstallationError): 22 """When installation of apk, apex, etc., fails.""" 23 24 25class InstallationTimeoutError(InstallationError): 26 """When installation of apk, apex, etc., times out.""" 27 28 29class StartInstrumentationError(TestException): 30 """When "am instrument" command has any error.""" 31 32 33class StartInstrumentationFailedError(StartInstrumentationError): 34 """When "am instrument" command fails.""" 35 36 37class StartInstrumentationTimeoutError(StartInstrumentationError): 38 """When "am instrument" command times out.""" 39 40 41class StartInstrumentationStdoutError(StartInstrumentationError): 42 """When the command to read the instrumentation stdout file.""" 43