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
17package com.android.documentsui;
18
19import static com.android.documentsui.StubProvider.ROOT_0_ID;
20import static com.android.documentsui.StubProvider.ROOT_1_ID;
21
22import android.test.suitebuilder.annotation.LargeTest;
23import android.test.suitebuilder.annotation.Suppress;
24
25@LargeTest
26public class RootsUiTest extends ActivityTest<FilesActivity> {
27
28    private static final String TAG = "RootUiTest";
29
30    public RootsUiTest() {
31        super(FilesActivity.class);
32    }
33
34    @Override
35    public void setUp() throws Exception {
36        super.setUp();
37        initTestFiles();
38    }
39
40    public void testRootTapped_GoToRootFromChildDir() throws Exception {
41        bots.directory.openDocument(dirName1);
42        bots.main.assertWindowTitle(dirName1);
43        bots.roots.openRoot(ROOT_0_ID);
44        bots.main.assertWindowTitle(ROOT_0_ID);
45        assertDefaultContentOfTestDir0();
46    }
47
48    @Suppress
49    public void testRootChanged_ClearSelection() throws Exception {
50        bots.directory.selectDocument(fileName1);
51        bots.main.assertInActionMode(true);
52
53        bots.roots.openRoot(ROOT_1_ID);
54        bots.main.assertInActionMode(false);
55    }
56
57}
58