2017-10-24 20:36:38 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Martijn Brekhof. All rights reserved.
|
|
|
|
*
|
|
|
|
* 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 org.xbmc.kore.tests.ui.remote.controlpad.http;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2020-04-21 19:29:05 +02:00
|
|
|
|
|
|
|
import androidx.test.rule.ActivityTestRule;
|
2017-10-24 20:36:38 +02:00
|
|
|
|
|
|
|
import org.junit.Rule;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.xbmc.kore.R;
|
|
|
|
import org.xbmc.kore.host.HostInfo;
|
|
|
|
import org.xbmc.kore.jsonrpc.method.Input;
|
|
|
|
import org.xbmc.kore.testhelpers.TestUtils;
|
|
|
|
import org.xbmc.kore.testhelpers.Utils;
|
|
|
|
import org.xbmc.kore.tests.ui.AbstractTestClass;
|
|
|
|
import org.xbmc.kore.ui.sections.remote.RemoteActivity;
|
|
|
|
|
2020-04-21 19:29:05 +02:00
|
|
|
import static androidx.test.espresso.Espresso.onView;
|
|
|
|
import static androidx.test.espresso.action.ViewActions.longClick;
|
|
|
|
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
2017-10-24 20:36:38 +02:00
|
|
|
|
|
|
|
public class KodiPreV17Tests extends AbstractTestClass<RemoteActivity> {
|
|
|
|
@Rule
|
|
|
|
public ActivityTestRule<RemoteActivity> remoteActivityActivityTestRule =
|
|
|
|
new ActivityTestRule<>(RemoteActivity.class);
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected ActivityTestRule<RemoteActivity> getActivityTestRule() {
|
|
|
|
return remoteActivityActivityTestRule;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void setSharedPreferences(Context context) {
|
|
|
|
Utils.setUseEventServerPreference(context, false);
|
|
|
|
}
|
|
|
|
|
2018-04-05 19:22:20 +02:00
|
|
|
@Override
|
|
|
|
public void setUp() throws Throwable {
|
|
|
|
setKodiMajorVersion(HostInfo.KODI_V16_JARVIS);
|
|
|
|
super.setUp();
|
|
|
|
}
|
|
|
|
|
2017-10-24 20:36:38 +02:00
|
|
|
@Test
|
2019-07-03 19:54:51 +02:00
|
|
|
public void infoControlPadButtonLongClickTest() {
|
2017-10-24 20:36:38 +02:00
|
|
|
onView(withId(R.id.info)).perform(longClick());
|
|
|
|
|
|
|
|
TestUtils.testHTTPEvent(Input.ExecuteAction.METHOD_NAME, Input.ExecuteAction.CODECINFO);
|
|
|
|
}
|
|
|
|
}
|