• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 static com.android.documentsui.StubProvider.ROOT_0_ID;
20 import static com.android.documentsui.StubProvider.ROOT_1_ID;
21 
22 import androidx.test.filters.LargeTest;
23 import androidx.test.filters.Suppress;
24 
25 import com.android.documentsui.files.FilesActivity;
26 import com.android.documentsui.filters.HugeLongTest;
27 
28 @LargeTest
29 public class SidebarUiTest extends ActivityTest<FilesActivity> {
30 
31     private static final String TAG = "RootUiTest";
32 
SidebarUiTest()33     public SidebarUiTest() {
34         super(FilesActivity.class);
35     }
36 
37     @Override
setUp()38     public void setUp() throws Exception {
39         super.setUp();
40         initTestFiles();
41     }
42 
43     @HugeLongTest
testRootTapped_GoToRootFromChildDir()44     public void testRootTapped_GoToRootFromChildDir() throws Exception {
45         bots.directory.openDocument(dirName1);
46         bots.breadcrumb.assertTitle(dirName1);
47         bots.roots.openRoot(ROOT_0_ID);
48         bots.main.assertWindowTitle(ROOT_0_ID);
49         assertDefaultContentOfTestDir0();
50     }
51 
52     @Suppress
testRootChanged_ClearSelection()53     public void testRootChanged_ClearSelection() throws Exception {
54         bots.directory.selectDocument(fileName1, 1);
55         bots.main.assertInActionMode(true);
56 
57         bots.roots.openRoot(ROOT_1_ID);
58         bots.main.assertInActionMode(false);
59     }
60 }
61