Aga Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 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; |
Aga Wronska | d559743 | 2016-02-26 11:36:07 -0800 | [diff] [blame] | 20 | import static com.android.documentsui.StubProvider.ROOT_1_ID; |
Aga Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 21 | |
Aga Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 22 | import android.test.suitebuilder.annotation.LargeTest; |
Aga Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 23 | |
| 24 | @LargeTest |
Steve McKay | b9a20d1 | 2016-02-19 12:57:05 -0800 | [diff] [blame] | 25 | public class RootsUiTest extends ActivityTest<FilesActivity> { |
Aga Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 26 | |
| 27 | private static final String TAG = "RootUiTest"; |
| 28 | |
Steve McKay | b9a20d1 | 2016-02-19 12:57:05 -0800 | [diff] [blame] | 29 | public RootsUiTest() { |
Aga Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 30 | super(FilesActivity.class); |
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public void setUp() throws Exception { |
| 35 | super.setUp(); |
| 36 | initTestFiles(); |
Aga Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | public void testRootTapped_GoToRootFromChildDir() throws Exception { |
Steve McKay | b9a20d1 | 2016-02-19 12:57:05 -0800 | [diff] [blame] | 40 | bots.directory.openDocument(dirName1); |
| 41 | bots.main.assertWindowTitle(dirName1); |
| 42 | bots.roots.openRoot(ROOT_0_ID); |
| 43 | bots.main.assertWindowTitle(ROOT_0_ID); |
Aga Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 44 | assertDefaultContentOfTestDir0(); |
| 45 | } |
Aga Wronska | d559743 | 2016-02-26 11:36:07 -0800 | [diff] [blame] | 46 | |
| 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 Wronska | e436f94 | 2016-02-08 12:00:38 -0800 | [diff] [blame] | 55 | } |