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