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

Commit dcb328a6 authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Override flag in PipController/PipTaskOrg.Test

PipController and PipTaskOrganizer in pip1 package
check for whether PiP2 flag is off before registering
certain listeners. These calls are actually checked
through verify() assertions in their respective unit tests.

So we should override the PiP2 flag to be disabled for these
unit tests (they still run but with enable_pip2=false always).

Also added myself to the list OWNERS in the wm.shell tests package.

Bug: 375599908
Flag: com.android.wm.shell.enable_pip2
Test: atest WMShellUnitTests
Change-Id: Iba57605d83c4e182dd30f06a34f534b70a938c2c
parent 29a390e3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ pablogamito@google.com
lbill@google.com
madym@google.com
hwwang@google.com
gabiyev@google.com
chenghsiuchang@google.com
atsjenk@google.com
jorgegil@google.com
+11 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ import android.content.ComponentName;
import android.content.pm.ActivityInfo;
import android.graphics.Rect;
import android.os.RemoteException;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.flag.junit.SetFlagsRule;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.util.Rational;
@@ -46,6 +48,7 @@ import android.window.WindowContainerToken;

import androidx.test.filters.SmallTest;

import com.android.wm.shell.Flags;
import com.android.wm.shell.MockSurfaceControlHelper;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.ShellTestCase;
@@ -65,6 +68,8 @@ import com.android.wm.shell.pip.phone.PhonePipMenuController;
import com.android.wm.shell.splitscreen.SplitScreenController;

import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
@@ -79,7 +84,13 @@ import java.util.Optional;
@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@DisableFlags(Flags.FLAG_ENABLE_PIP2)
public class PipTaskOrganizerTest extends ShellTestCase {
    @ClassRule
    public static final SetFlagsRule.ClassRule mClassRule = new SetFlagsRule.ClassRule();
    @Rule
    public final SetFlagsRule mSetFlagsRule = mClassRule.createSetFlagsRule();

    private PipTaskOrganizer mPipTaskOrganizer;

    @Mock private DisplayController mMockDisplayController;
+9 −0
Original line number Diff line number Diff line
@@ -42,11 +42,14 @@ import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.flag.junit.SetFlagsRule;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;

import androidx.test.filters.SmallTest;

import com.android.wm.shell.Flags;
import com.android.wm.shell.ShellTestCase;
import com.android.wm.shell.WindowManagerShellWrapper;
import com.android.wm.shell.common.DisplayController;
@@ -74,6 +77,8 @@ import com.android.wm.shell.sysui.ShellController;
import com.android.wm.shell.sysui.ShellInit;

import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -88,7 +93,11 @@ import java.util.Set;
@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@DisableFlags(Flags.FLAG_ENABLE_PIP2)
public class PipControllerTest extends ShellTestCase {
    @ClassRule public static final SetFlagsRule.ClassRule mClassRule = new SetFlagsRule.ClassRule();
    @Rule public final SetFlagsRule mSetFlagsRule = mClassRule.createSetFlagsRule();

    private PipController mPipController;
    private ShellInit mShellInit;
    private ShellController mShellController;