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

Commit 4e5a3231 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Add ImsCall constructor tests.

In the past a null profile could cause an exception on construction.
These tests verify that a null profile won't cause a crash and that if
the profile is present, the video state tracking takes places as expected.

Test: These are tests.
Fixes: 156188660
Change-Id: Ib1fbe8caf97381f3bd7235596307c5a2c3559b8f
parent ed4731a7
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.internal.telephony.imsphone;

import static junit.framework.Assert.assertNotNull;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
@@ -64,6 +66,25 @@ public class ImsCallTest extends TelephonyTest {
        assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
    }

    @Test
    @SmallTest
    public void testNullCallProfile() {
        ImsCall imsCall = new ImsCall(mContext, null /* imsCallProfile */);
        assertNotNull(imsCall);
        assertFalse(imsCall.wasVideoCall());
    }

    @Test
    @SmallTest
    public void testNonNulllVideoProfile() {
        ImsCallProfile profile = new ImsCallProfile();
        profile.mCallType = ImsCallProfile.CALL_TYPE_VT_TX;

        ImsCall imsCall = new ImsCall(mContext, profile);
        assertNotNull(imsCall);
        assertTrue(imsCall.wasVideoCall());
    }

    @Test
    @SmallTest
    public void testSetWifi() {