namespace Tizen.System.Tests
{
-
public class SupportChecker
{
public static bool IsSupported(string feature)
return supported;
return false;
+ }\r
+\r
+ public enum Profile\r
+ {\r
+ tv,\r
+ wearable,\r
+ mobile,\r
}
- public static bool IsTV()
- {
- bool is_successful = Tizen.System.Information.TryGetValue<string>("http://tizen.org/feature/profile", out string profile);
-
-
- if (is_successful && string.Compare(profile, "tv") == 0)
- return true;
-
- return false;
- }
-
- public static bool IsWearable()
- {
- bool is_successful = Tizen.System.Information.TryGetValue<string>("http://tizen.org/feature/profile", out string profile);
-
- if (is_successful && string.Compare(profile, "wearable") == 0)
- return true;
-
- return false;
+ public static bool IsSpecificProfile(Profile profile)\r
+ {\r
+ bool is_successful = Tizen.System.Information.TryGetValue<string>("http://tizen.org/feature/profile", out string val);\r
+\r
+ if (!is_successful)\r
+ return false;\r
+\r
+ if (string.Compare(val, profile.ToString()) != 0)\r
+ return false;\r
+\r
+ // DA platform is based on mobile profile, so we have to exclude it\r
+ if (profile == Profile.mobile && IsDA())\r
+ return false;\r
+\r
+ return true;\r
}
public static bool IsMobileNetworksMenuSupported()
{
- bool is_successful;
+ // Mobile networks menu only available in ARM mobile device
- is_successful = Tizen.System.Information.TryGetValue<string>("http://tizen.org/feature/platform.core.cpu.arch", out string arch);
- if (!is_successful || string.Compare(arch, 0, "arm", 0, 3) != 0)
+ if (!IsSpecificProfile(Profile.mobile))
+ return false;\r
+\r
+ bool is_successful = Tizen.System.Information.TryGetValue<string>("http://tizen.org/feature/platform.core.cpu.arch", out string arch);\r
+ if (!is_successful || string.Compare(arch, 0, "arm", 0, 3) != 0)\r
return false;
- is_successful = Tizen.System.Information.TryGetValue<string>("http://tizen.org/feature/profile", out string profile);
- if (!is_successful || string.Compare(profile, "mobile") != 0)
- return false;
return true;
+ }\r
+\r
+ public static bool IsDA()
+ {
+ bool is_successful = Tizen.System.Information.TryGetValue<string>("http://tizen.org/feature/platform.communication_processor", out string cp);
+ if (!is_successful)
+ return false;\r
+\r
+ // QCA9379 : Family Hub (KantM, Meson64)\r
+ // AR1021X : R18 based device\r
+ if (string.Compare(cp, "QCA9379") == 0 || (string.Compare(cp, "AR1021X") == 0))
+ return true;
+
+ return false;
}
}
-
}
[Step(1, "Click Run button")]
[Step(2, "Enable Bluetooth : Settings-> Bluetooth -> Bluetooth Enable")]
public async Task BluetoothEnabled_CHECK_ENABLE() {
- if (!SupportChecker.IsTV() && SupportChecker.IsSupported("http://tizen.org/feature/network.bluetooth"))
+ if (SupportChecker.IsSupported("http://tizen.org/feature/network.bluetooth") &&
+ !SupportChecker.IsSpecificProfile(SupportChecker.Profile.tv) &&
+ !SupportChecker.IsDA())
{
Information.SetCallback(Bluetooth, BluetoothEnableCallback);
await ManualTest.WaitForConfirm();
[Precondition(2, "Bluetooth should be already enabled")]
[Step(1, "Click run button")]
[Step(2, "Disable Bluetooth : Settings-> Bluetooth -> Bluetooth Disable")]
- public async Task BluetoothEnabled_CHECK_DISABLE() {
- if (!SupportChecker.IsTV() && SupportChecker.IsSupported("http://tizen.org/feature/network.bluetooth"))
+ public async Task BluetoothEnabled_CHECK_DISABLE() {\r
+ if (SupportChecker.IsSupported("http://tizen.org/feature/network.bluetooth") &&\r
+ !SupportChecker.IsSpecificProfile(SupportChecker.Profile.tv) &&\r
+ !SupportChecker.IsDA())
{
Information.SetCallback(Bluetooth, BluetoothDisableCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "Enable Vibration : Open Quick panel -> Toggle sound button until it is in vibrate mode")]
public async Task VibrationEnabled_CHECK_ENABLE() {
- if (!SupportChecker.IsTV())
+ if (SupportChecker.IsSupported("http://tizen.org/feature/feedback.vibration"))
{
Information.SetCallback(Vibration, VibrationEnableCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "Disable Vibration : Open Quick panel -> Toggle sound button until it is in silent mode")]
public async Task VibrationEnabled_CHECK_DISABLE() {
- if (!SupportChecker.IsTV())
+ if (SupportChecker.IsSupported("http://tizen.org/feature/feedback.vibration"))
{
Information.SetCallback(Vibration, VibrationDisableCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "AudioJackConnected Connected: Connect an audio jack to phone")]
public async Task AudioJackConnected_CHECK_CONNECTED() {
- if (!SupportChecker.IsTV() && !SupportChecker.IsWearable())
+ if (SupportChecker.IsSpecificProfile(SupportChecker.Profile.mobile))
{
Information.SetCallback(AudioJack, AudioJackEnableCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "AudioJackConnected Disconnected: Disconnect the audio jack from phone")]
public async Task AudioJackConnected_CHECK_DISCONNECTED() {
- if (!SupportChecker.IsTV() && !SupportChecker.IsWearable())
+ if (SupportChecker.IsSpecificProfile(SupportChecker.Profile.mobile))
{
Information.SetCallback(AudioJack, AudioJackDisableCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "TvOut: Connect a TVOut connector like micro-USB-to-HDMI to the phone")]
public async Task TvOutConnected_CHECK_CONNECTED() {
- if ((SupportChecker.IsSupported("http://tizen.org/feature/screen.output.hdmi") || SupportChecker.IsSupported("http://tizen.org/feature/screen.output.rca")) && SupportChecker.IsSupported("http://tizen.org/feature/screen"))
+ if ((SupportChecker.IsSupported("http://tizen.org/feature/screen.output.hdmi") || SupportChecker.IsSupported("http://tizen.org/feature/screen.output.rca")) &&
+ SupportChecker.IsSupported("http://tizen.org/feature/screen"))
{
Information.SetCallback(TvOut, TvOutConnectedCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "TvOut: Disonnect TVOut connector like micro-USB-to-HDMI from the phone")]
public async Task TvOutConnected_CHECK_DISCONNECTED() {
- if (SupportChecker.IsSupported("http://tizen.org/feature/screen.output.hdmi") || SupportChecker.IsSupported("http://tizen.org/feature/screen.output.rca"))
+ if ((SupportChecker.IsSupported("http://tizen.org/feature/screen.output.hdmi") || SupportChecker.IsSupported("http://tizen.org/feature/screen.output.rca")) &&\r
+ SupportChecker.IsSupported("http://tizen.org/feature/screen"))
{
Information.SetCallback(TvOut, TvOutDisconnectedCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "AudioJackConnector: Connect 3-wire or 4-wire AudioJack")]
public async Task AudioJackConnectorChanged_TEST() {
- if (!SupportChecker.IsTV() && !SupportChecker.IsWearable())
+ if (SupportChecker.IsSpecificProfile(SupportChecker.Profile.mobile))
{
Information.SetCallback(AudioJackConnector, AudioJackConnectorCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "Connect a battery charger to the phone")]
public async Task ChargerConnected_CHECK_CONNECTED() {
- if (!SupportChecker.IsTV() && SupportChecker.IsSupported("http://tizen.org/feature/battery"))
+ if (SupportChecker.IsSupported("http://tizen.org/feature/battery"))
{
Information.SetCallback(Charger, ChargerConnectedCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "Disonnect a battery charger from the phone")]
public async Task ChargerConnected_CHECK_DISCONNECTED() {
- if (!SupportChecker.IsTV() && SupportChecker.IsSupported("http://tizen.org/feature/battery"))
+ if (SupportChecker.IsSupported("http://tizen.org/feature/battery"))
{
Information.SetCallback(Charger, ChargerDisconnectedCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "Enable AutoRotation: Home screen -> Drop down menu -> Auto Rotate -> Enable ")]
public async Task AutoRotationEnabled_CHECK_ENABLE() {
- if (SupportChecker.IsSupported("http://tizen.org/feature/screen.auto_rotation") && !SupportChecker.IsWearable())
+ if (SupportChecker.IsSupported("http://tizen.org/feature/screen.auto_rotation"))
{
Information.SetCallback(AutoRotation, AutoRotationEnableCallback);
await ManualTest.WaitForConfirm();
[Step(1, "Click Run button")]
[Step(2, "Disable AutoRotation: Home screen -> Drop down menu -> Auto Rotate -> Disable ")]
public async Task AutoRotationEnabled_CHECK_DISABLE() {
- if (SupportChecker.IsSupported("http://tizen.org/feature/screen.auto_rotation") && !SupportChecker.IsWearable())
+ if (SupportChecker.IsSupported("http://tizen.org/feature/screen.auto_rotation"))
{
Information.SetCallback(AutoRotation, AutoRotationDisableCallback);
await ManualTest.WaitForConfirm();