9569ce86a2
Before we use TaskbarModeSwitch but had a drawback where we would not know which variant of taskbar the test failed for. So, we split the taskbar tests into transient and persistent for better error logs and debugging. But, now we can use Parameterized Test Runner to achieve the same and do not have to duplicate test code for testing two different variants of Taskbar. There can be instances where we only want to test certain taskbar variant only, we have separated files for that. Test: Presubmit Bug: 267648422 Flag: not needed Change-Id: I4322498f13d257a5f1793b008f45b09ac9b9f3ff
54 lines
1.7 KiB
Java
54 lines
1.7 KiB
Java
/*
|
|
* Copyright (C) 2022 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
package com.android.quickstep;
|
|
|
|
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
|
|
|
|
import androidx.test.filters.LargeTest;
|
|
import androidx.test.runner.AndroidJUnit4;
|
|
|
|
import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch;
|
|
|
|
import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
|
|
@LargeTest
|
|
@RunWith(AndroidJUnit4.class)
|
|
public class TaplTestsPersistentTaskbar extends AbstractTaplTestsTaskbar {
|
|
|
|
@Override
|
|
public void setUp() throws Exception {
|
|
mTaskbarWasInTransientMode = isTaskbarInTransientMode(mTargetContext);
|
|
setTaskbarMode(mLauncher, false);
|
|
super.setUp();
|
|
}
|
|
|
|
@Test
|
|
@TaskbarModeSwitch(mode = PERSISTENT)
|
|
public void testHideShowTaskbar() {
|
|
getTaskbar().hide();
|
|
mLauncher.getLaunchedAppState().showTaskbar();
|
|
}
|
|
|
|
@Test
|
|
@TaskbarModeSwitch(mode = PERSISTENT)
|
|
public void testHideTaskbarPersistsOnRecreate() {
|
|
getTaskbar().hide();
|
|
mLauncher.recreateTaskbar();
|
|
mLauncher.getLaunchedAppState().assertTaskbarHidden();
|
|
}
|
|
}
|