Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2151fd3 authored by William Escande's avatar William Escande
Browse files

Trunk Stable/OppReceiver: do not skip test

Bug: 324658330
Bug: 323096132
Test: m Bluetooth | mechanical refactor
Change-Id: I525cf2f0368d850bbb1a61fdd0ecfc4b90820336
parent e5019b79
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -42,10 +42,7 @@ import android.content.ContextWrapper;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.platform.test.annotations.RequiresFlagsDisabled;
import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.platform.test.flag.junit.SetFlagsRule;

import androidx.test.core.app.ActivityScenario;
import androidx.test.espresso.intent.Intents;
@@ -73,8 +70,7 @@ import java.util.List;
@RunWith(AndroidJUnit4.class)
public class BluetoothOppReceiverTest {

    @Rule
    public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
    @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();

    Context mContext;

@@ -129,8 +125,8 @@ public class BluetoothOppReceiverTest {
    }

    @Test
    @RequiresFlagsDisabled(Flags.FLAG_OPP_START_ACTIVITY_DIRECTLY_FROM_NOTIFICATION)
    public void onReceive_withActionIncomingFileConfirm_startsIncomingFileConfirmActivity() {
        mSetFlagsRule.disableFlags(Flags.FLAG_OPP_START_ACTIVITY_DIRECTLY_FROM_NOTIFICATION);
        Intent intent = new Intent();
        intent.setAction(Constants.ACTION_INCOMING_FILE_CONFIRM);
        intent.setData(Uri.parse("content:///not/important"));
@@ -163,8 +159,8 @@ public class BluetoothOppReceiverTest {
    }

    @Test
    @RequiresFlagsDisabled(Flags.FLAG_OPP_START_ACTIVITY_DIRECTLY_FROM_NOTIFICATION)
    public void onReceive_withActionOutboundTransfer_startsTransferHistoryActivity() {
        mSetFlagsRule.disableFlags(Flags.FLAG_OPP_START_ACTIVITY_DIRECTLY_FROM_NOTIFICATION);
        Intent intent = new Intent();
        intent.setAction(Constants.ACTION_OPEN_OUTBOUND_TRANSFER);
        intent.setData(Uri.parse("content:///not/important"));
@@ -177,8 +173,8 @@ public class BluetoothOppReceiverTest {
    }

    @Test
    @RequiresFlagsDisabled(Flags.FLAG_OPP_START_ACTIVITY_DIRECTLY_FROM_NOTIFICATION)
    public void onReceive_withActionInboundTransfer_startsTransferHistoryActivity() {
        mSetFlagsRule.disableFlags(Flags.FLAG_OPP_START_ACTIVITY_DIRECTLY_FROM_NOTIFICATION);
        Intent intent = new Intent();
        intent.setAction(Constants.ACTION_OPEN_INBOUND_TRANSFER);
        intent.setData(Uri.parse("content:///not/important"));
@@ -216,8 +212,8 @@ public class BluetoothOppReceiverTest {
    }

    @Test
    @RequiresFlagsDisabled(Flags.FLAG_OPP_FIX_MULTIPLE_NOTIFICATIONS_ISSUES)
    public void onReceive_withActionCompleteHide_makeAllVisibilityHidden() {
        mSetFlagsRule.disableFlags(Flags.FLAG_OPP_FIX_MULTIPLE_NOTIFICATIONS_ISSUES);
        Intent intent = new Intent();
        intent.setAction(Constants.ACTION_COMPLETE_HIDE);
        mReceiver.onReceive(mContext, intent);
@@ -227,8 +223,8 @@ public class BluetoothOppReceiverTest {
    }

    @Test
    @RequiresFlagsEnabled(Flags.FLAG_OPP_FIX_MULTIPLE_NOTIFICATIONS_ISSUES)
    public void onReceive_withActionHideCompletedInboundTransfer_makesInboundVisibilityHidden() {
        mSetFlagsRule.enableFlags(Flags.FLAG_OPP_FIX_MULTIPLE_NOTIFICATIONS_ISSUES);
        Intent intent = new Intent();
        intent.setAction(Constants.ACTION_HIDE_COMPLETED_INBOUND_TRANSFER);
        mReceiver.onReceive(mContext, intent);
@@ -246,8 +242,8 @@ public class BluetoothOppReceiverTest {
    }

    @Test
    @RequiresFlagsEnabled(Flags.FLAG_OPP_FIX_MULTIPLE_NOTIFICATIONS_ISSUES)
    public void onReceive_withActionHideCompletedOutboundTransfer_makesOutboundVisibilityHidden() {
        mSetFlagsRule.enableFlags(Flags.FLAG_OPP_FIX_MULTIPLE_NOTIFICATIONS_ISSUES);
        Intent intent = new Intent();
        intent.setAction(Constants.ACTION_HIDE_COMPLETED_OUTBOUND_TRANSFER);
        mReceiver.onReceive(mContext, intent);