1 /*
2  * Copyright (C) 2023 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 package com.android.launcher3.tapl;
17 
18 import androidx.test.uiautomator.UiObject2;
19 
20 /**
21  * Operations on search result page opened from Taskbar qsb.
22  */
23 public class SearchResultFromTaskbarQsb extends SearchResultFromQsb {
24 
SearchResultFromTaskbarQsb(LauncherInstrumentation launcher)25     SearchResultFromTaskbarQsb(LauncherInstrumentation launcher) {
26         super(launcher);
27     }
28 
29     @Override
findAppIcon(String appName)30     public TaskbarAppIcon findAppIcon(String appName) {
31         return (TaskbarAppIcon) super.findAppIcon(appName);
32     }
33 
34     @Override
createAppIcon(UiObject2 icon)35     protected TaskbarAppIcon createAppIcon(UiObject2 icon) {
36         return new TaskbarAppIcon(mLauncher, icon);
37     }
38 
39     @Override
findWebSuggestion(String text)40     public TaskbarSearchWebSuggestion findWebSuggestion(String text) {
41         return (TaskbarSearchWebSuggestion) super.findWebSuggestion(text);
42     }
43 
44     @Override
createWebSuggestion(UiObject2 webSuggestion)45     protected TaskbarSearchWebSuggestion createWebSuggestion(UiObject2 webSuggestion) {
46         return new TaskbarSearchWebSuggestion(mLauncher, webSuggestion);
47     }
48 
49     @Override
verifyVisibleContainerOnDismiss()50     protected void verifyVisibleContainerOnDismiss() {
51         mLauncher.getLaunchedAppState().assertTaskbarVisible();
52     }
53 
54     @Override
tapOutside(boolean tapRight, UiObject2 allAppsBottomSheet)55     protected void tapOutside(boolean tapRight, UiObject2 allAppsBottomSheet) {
56         mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight);
57     }
58 }
59