|
| 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 | +package android.content; |
| 17 | + |
| 18 | +import android.content.ContentResolver; |
| 19 | +import android.provider.ContactsContract; |
| 20 | +import android.test.AndroidTestCase; |
| 21 | +import android.test.suitebuilder.annotation.LargeTest; |
| 22 | + |
| 23 | +public class ContentResolverTest extends AndroidTestCase { |
| 24 | + private ContentResolver mContentResolver; |
| 25 | + |
| 26 | + @Override |
| 27 | + protected void setUp() throws Exception { |
| 28 | + super.setUp(); |
| 29 | + mContentResolver = mContext.getContentResolver(); |
| 30 | + } |
| 31 | + |
| 32 | + @LargeTest |
| 33 | + public void testCursorFinalizer() throws Exception { |
| 34 | + // TODO: Want a test case that more predictably reproduce this issue. Selected |
| 35 | + // 600 as this causes the problem 100% of the runs on current hw, it might not |
| 36 | + // do so on some other configuration though. |
| 37 | + for (int i = 0; i < 600; i++) { |
| 38 | + mContentResolver.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); |
| 39 | + } |
| 40 | + } |
| 41 | +} |
0 commit comments