blob: 73c1c5ffc955e10cb4a71467d43ad82f93d61f85 [file] [log] [blame]
Aga Wronskae436f942016-02-08 12:00:38 -08001/*
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;
Aga Wronskad5597432016-02-26 11:36:07 -080020import static com.android.documentsui.StubProvider.ROOT_1_ID;
Aga Wronskae436f942016-02-08 12:00:38 -080021
Aga Wronskae436f942016-02-08 12:00:38 -080022import android.test.suitebuilder.annotation.LargeTest;
Aga Wronskae436f942016-02-08 12:00:38 -080023
24@LargeTest
Steve McKayb9a20d12016-02-19 12:57:05 -080025public class RootsUiTest extends ActivityTest<FilesActivity> {
Aga Wronskae436f942016-02-08 12:00:38 -080026
27 private static final String TAG = "RootUiTest";
28
Steve McKayb9a20d12016-02-19 12:57:05 -080029 public RootsUiTest() {
Aga Wronskae436f942016-02-08 12:00:38 -080030 super(FilesActivity.class);
31 }
32
33 @Override
34 public void setUp() throws Exception {
35 super.setUp();
36 initTestFiles();
Aga Wronskae436f942016-02-08 12:00:38 -080037 }
38
39 public void testRootTapped_GoToRootFromChildDir() throws Exception {
Steve McKayb9a20d12016-02-19 12:57:05 -080040 bots.directory.openDocument(dirName1);
41 bots.main.assertWindowTitle(dirName1);
42 bots.roots.openRoot(ROOT_0_ID);
43 bots.main.assertWindowTitle(ROOT_0_ID);
Aga Wronskae436f942016-02-08 12:00:38 -080044 assertDefaultContentOfTestDir0();
45 }
Aga Wronskad5597432016-02-26 11:36:07 -080046
47 public void testRootChanged_ClearSelection() throws Exception {
48 bots.directory.selectDocument(fileName1);
49 bots.main.assertInActionMode(true);
50
51 bots.roots.openRoot(ROOT_1_ID);
52 bots.main.assertInActionMode(false);
53 }
54
Aga Wronskae436f942016-02-08 12:00:38 -080055}