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

Commit c7ab1f77 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "TEST: Fix Broken Java unit tests"

parents 14d8eebb 10e52584
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -7,13 +7,13 @@ import android.content.Intent;
import android.support.test.filters.MediumTest;
import android.test.AndroidTestCase;

import com.android.bluetooth.R;
import com.android.bluetooth.btservice.AdapterService;

@MediumTest
public class HeadsetClientServiceTest extends AndroidTestCase {
    // Time to wait for the service to be initialized
    private static final int SERVICE_START_TIMEOUT_MS = 5000;  // 5 sec
    private static final int STATE_MACHINE_TRANSITION_TIMEOUT_MS = 5000;  // 5 sec
    private HeadsetClientService mService = null;
    private BluetoothAdapter mAdapter = null;

@@ -41,6 +41,11 @@ public class HeadsetClientServiceTest extends AndroidTestCase {

    @Override
    protected void setUp() throws Exception {
        // On phone side, HeadsetClientService may not be included in the APK and thus the test
        // should be skipped
        if (!getContext().getResources().getBoolean(R.bool.profile_supported_hfpclient)) {
            return;
        }
        startServices();
    }

+5 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public class PbapParserTest extends AndroidTestCase {
        } catch (Exception e) {
            fail("Setup Failure Unable to get resources" + e.toString());
        }
        cleanupCallLog();
    }

    // testNoTimestamp should parse 1 poorly formed vcard and not crash.
@@ -114,6 +115,10 @@ public class PbapParserTest extends AndroidTestCase {
        assertTrue(verifyCallLog("", "1483232580000", "3"));
    }

    void cleanupCallLog() {
        mContext.getContentResolver().delete(Calls.CONTENT_URI, null, null);
    }

    // Find Entries in call log with type matching number and date.
    // If number or date is null it will match any number or date respectively.
    boolean verifyCallLog(String number, String date, String type) {