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 android.platform.test.helpers; 18 19 import android.app.Instrumentation; 20 import android.support.test.uiautomator.Direction; 21 22 public abstract class AbstractChromeHelper extends AbstractStandardAppHelper { 23 24 public AbstractChromeHelper(Instrumentation instr) { 25 super(instr); 26 } 27 28 /** 29 * Setup expectations: Chrome is open and on a standard page, i.e. a tab is open. 30 * 31 * This method will open the URL supplied and block until the page is open. 32 */ 33 public abstract void openUrl(String url); 34 35 /** 36 * Setup expectations: Chrome is open on a page. 37 * 38 * This method will scroll the page as directed and block until idle. 39 */ 40 public abstract void flingPage(Direction dir); 41 42 /** 43 * Setup expectations: Chrome is open on a page. 44 * 45 * This method will open the overload menu, indicated by three dots and block until open. 46 */ 47 public abstract void openMenu(); 48 49 /** 50 * Setup expectations: Chrome is open on a page and the tabs are treated as apps. 51 * 52 * This method will change the settings to treat tabs inside of Chrome and block until Chrome is 53 * open on the original tab. 54 */ 55 public abstract void mergeTabs(); 56 57 /** 58 * Setup expectations: Chrome is open on a page and the tabs are merged. 59 * 60 * This method will change the settings to treat tabs outside of Chrome and block until Chrome 61 * is open on the original tab. 62 */ 63 public abstract void unmergeTabs(); 64 } 65