Home | History | Annotate | Download | only in contacts
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.contacts;
     18 
     19 import android.test.ActivityUnitTestCase;
     20 import android.test.suitebuilder.annotation.SmallTest;
     21 
     22 import com.android.contacts.activities.ContactDetailActivity;
     23 import com.android.contacts.common.test.mocks.ContactsMockContext;
     24 import com.android.contacts.common.test.mocks.MockContentProvider;
     25 
     26 @SmallTest
     27 public class ContactDetailTest extends ActivityUnitTestCase<ContactDetailActivity> {
     28     private ContactsMockContext mContext;
     29     private MockContentProvider mContactsProvider;
     30 
     31     public ContactDetailTest() {
     32         super(ContactDetailActivity.class);
     33     }
     34 
     35     @Override
     36     protected void setUp() throws Exception {
     37         super.setUp();
     38         mContext = new ContactsMockContext(getInstrumentation().getTargetContext());
     39         mContactsProvider = mContext.getContactsProvider();
     40         setActivityContext(mContext);
     41     }
     42 
     43     @Override
     44     protected void tearDown() throws Exception {
     45         super.tearDown();
     46     }
     47 
     48 //    public void testFoo() {
     49 //        // Use lookup-style Uris that also contain the Contact-ID
     50 //        //long rawContactId1 = mCreator.createRawContact("JohnDoe", "John", "Doe");
     51 //        //long contactId1 = mCreator.getContactIdByRawContactId(rawContactId1);
     52 //        //Uri contactUri1 = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId1);
     53 //        Intent intent = new Intent(Intent.ACTION_VIEW,
     54 //                ContentUris.withAppendedId(Contacts.CONTENT_URI, 123));
     55 //        startActivity(intent, null, null);
     56 //        ContactDetailActivity activity = getActivity();
     57 //        mContactsProvider.verify();
     58 //    }
     59 }
     60