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

Commit 9abdadc5 authored by Kai Wang's avatar Kai Wang Committed by Gerrit Code Review
Browse files

Merge "Bluetooth Unit Test"

parents 82ef8032 f93b2a4e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ public class HeadsetClientServiceTest extends AndroidTestCase {
        assertTrue(mService != null);

        // At this point Adapter Service should have started
        AdapterService inst = AdapterService.getAdapterService();
        AdapterService inst = mock(AdapterService.class);
        assertTrue(inst != null);

        // Try getting the Bluetooth adapter
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ import java.util.ArrayList;
import com.android.bluetooth.btservice.AdapterService;

import static org.mockito.Mockito.*;

import org.mockito.ArgumentCaptor;

public class HeadsetClientStateMachineTest extends AndroidTestCase {
@@ -25,7 +26,7 @@ public class HeadsetClientStateMachineTest extends AndroidTestCase {

    @Override
    protected void setUp() throws Exception {
        AdapterService inst = AdapterService.getAdapterService();
        AdapterService inst = mock(AdapterService.class);
        assertTrue(inst != null);
        mAdapter = BluetoothAdapter.getDefaultAdapter();
    }
+8 −7
Original line number Diff line number Diff line
@@ -81,11 +81,11 @@ public class PbapParserTest extends AndroidTestCase {
        processor.setResults(pbapVCardList.getList());

        // Verify that these entries aren't in the call log to start.
        assertFalse(verifyCallLog("555-0002", "1483232460000", "3"));

        // EST is default Time Zone
        assertFalse(verifyCallLog("555-0002", "1483250460000", "3"));
        // Finish processing the data and verify entries were added to the call log.
        processor.onPullComplete();
        assertTrue(verifyCallLog("555-0002", "1483232460000", "3"));
        assertTrue(verifyCallLog("555-0002", "1483250460000", "3"));
    }

    // testUnknownCall should parse two calls with no phone number.
@@ -102,13 +102,14 @@ public class PbapParserTest extends AndroidTestCase {
        processor.setResults(pbapVCardList.getList());

        // Verify that these entries aren't in the call log to start.
        assertFalse(verifyCallLog("", "1483232520000", "3"));
        assertFalse(verifyCallLog("", "1483232580000", "3"));
        // EST is default Time Zone
        assertFalse(verifyCallLog("", "1483250520000", "3"));
        assertFalse(verifyCallLog("", "1483250580000", "3"));

        // Finish processing the data and verify entries were added to the call log.
        processor.onPullComplete();
        assertTrue(verifyCallLog("", "1483232520000", "3"));
        assertTrue(verifyCallLog("", "1483232580000", "3"));
        assertTrue(verifyCallLog("", "1483250520000", "3"));
        assertTrue(verifyCallLog("", "1483250580000", "3"));
    }

    // Find Entries in call log with type matching number and date.