1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.autofillservice.cts.augmented;
18 
19 import com.android.compatibility.common.util.Timeout;
20 
21 /**
22  * Timeouts for common tasks.
23  */
24 final class AugmentedTimeouts {
25 
26     private static final long ONE_TIMEOUT_TO_RULE_THEN_ALL_MS = 1_000;
27     private static final long ONE_NAPTIME_TO_RULE_THEN_ALL_MS = 3_000;
28 
29     /**
30      * Timeout for expected augmented autofill requests.
31      */
32     static final Timeout AUGMENTED_FILL_TIMEOUT = new Timeout("AUGMENTED_FILL_TIMEOUT",
33             ONE_TIMEOUT_TO_RULE_THEN_ALL_MS, 2F, ONE_TIMEOUT_TO_RULE_THEN_ALL_MS);
34 
35     /**
36      * Timeout until framework binds / unbinds from service.
37      */
38     static final Timeout AUGMENTED_CONNECTION_TIMEOUT = new Timeout("AUGMENTED_CONNECTION_TIMEOUT",
39             ONE_TIMEOUT_TO_RULE_THEN_ALL_MS, 2F, ONE_TIMEOUT_TO_RULE_THEN_ALL_MS);
40 
41     /**
42      * Timeout used when the augmented autofill UI not expected to be shown - test will sleep for
43      * that amount of time as there is no callback that be received to assert it's not shown.
44      */
45     static final long AUGMENTED_UI_NOT_SHOWN_NAPTIME_MS = ONE_NAPTIME_TO_RULE_THEN_ALL_MS;
46 
AugmentedTimeouts()47     private AugmentedTimeouts() {
48         throw new UnsupportedOperationException("contain static methods only");
49     }
50 }
51