1 /*
2  * Copyright (C) 2016 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 com.android.documentsui;
18 
19 import androidx.test.filters.LargeTest;
20 
21 import com.android.documentsui.files.FilesActivity;
22 
23 @LargeTest
24 public class GestureSelectionUiTest extends ActivityTest<FilesActivity> {
25 
GestureSelectionUiTest()26     public GestureSelectionUiTest() {
27         super(FilesActivity.class);
28     }
29 
30     @Override
setUp()31     public void setUp() throws Exception {
32         super.setUp();
33         initTestFiles();
34         bots.roots.closeDrawer();
35     }
36 
testGridGestureSelect_twoFiles()37     public void testGridGestureSelect_twoFiles() throws Exception {
38         bots.main.switchToGridMode();
39         bots.gesture.gestureSelectFiles(fileName1, fileName2);
40 
41         bots.directory.assertSelection(2);
42     }
43 
testGridGestureSelect_multipleFiles()44     public void testGridGestureSelect_multipleFiles() throws Exception {
45         bots.main.switchToGridMode();
46         bots.gesture.gestureSelectFiles(fileName2, dirName1);
47 
48         bots.directory.assertSelection(3);
49 
50     }
51 
testListGestureSelect_twoFiles()52     public void testListGestureSelect_twoFiles() throws Exception {
53         bots.main.switchToListMode();
54         bots.gesture.gestureSelectFiles(fileName1, fileName2);
55 
56         bots.directory.assertSelection(2);
57 
58     }
59 
testListGestureSelect_multipleFiles()60     public void testListGestureSelect_multipleFiles() throws Exception {
61         bots.main.switchToListMode();
62         bots.gesture.gestureSelectFiles(fileName2, dirName1);
63 
64         bots.directory.assertSelection(3);
65 
66     }
67 }
68