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

Commit 7d7591f5 authored by Yorke Lee's avatar Yorke Lee Committed by Android (Google) Code Review
Browse files

Merge "Fix some broken Dialer tests" into lmp-mr1-dev

parents 2f44b3c9 6c86e632
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public class DialerUtils {
     */
    public static void startActivityWithErrorToast(Context context, Intent intent, int msgId) {
        try {
            if (Intent.ACTION_CALL.equals(intent.getAction())) {
            if (Intent.ACTION_CALL.equals(intent.getAction()) && context instanceof Activity) {
                // All dialer-initiated calls should pass the touch point to the InCallUI
                Point touchPoint = TouchPointManager.getInstance().getPoint();
                if (touchPoint.x != 0 || touchPoint.y != 0) {
+3 −2
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.widget.FrameLayout;
import com.android.contacts.common.test.FragmentTestActivity;
import com.android.dialer.CallDetailActivity;
import com.android.dialer.R;
import com.android.dialer.util.TestConstants;

import java.util.Date;
import java.util.Formatter;
@@ -323,7 +324,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme
        IntentProvider intentProvider = (IntentProvider) views.callBackButtonView.getTag();
        Intent intent = intentProvider.getIntent(mActivity);
        // Starts a call.
        assertEquals(Intent.ACTION_CALL_PRIVILEGED, intent.getAction());
        assertEquals(TestConstants.CALL_INTENT_ACTION, intent.getAction());
        // To the entry's number.
        assertEquals(Uri.parse("tel:" + TEST_NUMBER), intent.getData());
    }
@@ -385,7 +386,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme
                Intent callIntent = intentProvider.getIntent(mActivity);

                //The intent should be to make the call
                assertEquals(Intent.ACTION_CALL_PRIVILEGED, callIntent.getAction());
                assertEquals(TestConstants.CALL_INTENT_ACTION, callIntent.getAction());
            }
        }
    }
+3 −2
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.contacts.common.test.mocks.MockContentProvider;
import com.android.contacts.common.test.mocks.MockContentProvider.Query;
import com.android.contacts.common.util.ContactDisplayUtils;
import com.android.dialer.interactions.PhoneNumberInteraction.PhoneItem;
import com.android.dialer.util.TestConstants;

import java.util.ArrayList;
import java.util.List;
@@ -179,7 +180,7 @@ public class PhoneNumberInteractionTest extends InstrumentationTestCase {
        Intent intent = mContext.getIntentForStartActivity();
        assertNotNull(intent);

        assertEquals(Intent.ACTION_CALL_PRIVILEGED, intent.getAction());
        assertEquals(TestConstants.CALL_INTENT_ACTION, intent.getAction());
        assertEquals("tel:123", intent.getDataString());
    }

@@ -197,7 +198,7 @@ public class PhoneNumberInteractionTest extends InstrumentationTestCase {
        Intent intent = mContext.getIntentForStartActivity();
        assertNotNull(intent);

        assertEquals(Intent.ACTION_CALL_PRIVILEGED, intent.getAction());
        assertEquals(TestConstants.CALL_INTENT_ACTION, intent.getAction());
        assertEquals("sip:example%40example.com", intent.getDataString());
    }

+7 −0
Original line number Diff line number Diff line
package com.android.dialer.util;

import android.content.Intent;

public class TestConstants {
    public static final String CALL_INTENT_ACTION = Intent.ACTION_CALL;
}