aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2017-06-05Allow updating TIMES_CONTACTED again.android-vts-8.0_r2android-vts-8.0_r1oreo-devMakoto Onuki
Explicitly setting to TIMES_CONTACTED was allowed on pre-N builds. We tried to disable it for O, but turned out some system apps are using it. Let's re-open it. Test: adb shell am instrument -w com.android.providers.contacts.tests Test: adb shell am instrument -w -e package android.provider.cts.contacts android.provider.cts/android.support.test.runner.AndroidJUnitRunner Bug: 35321783 Change-Id: I07af087256cc9908b031bd8dfbd9fad479d4681f
2017-05-04Fix unit testsmike dooley
Fixing tests that broke when new database column, transcription_state was added (ag/2129944, ag/2129909). Test: ran ContactProvider unit tests Bug: 37952129 Change-Id: Iec466dd40e83e6b91b336c479cf3919333a07781
2017-04-03Fix unit tests.Makoto Onuki
Bug: 36853669 Test: adb shell am instrument -w com.android.providers.contacts.tests Change-Id: I2fdef3fdea5c2ce2b7336987e371d7f67a229112
2017-03-20Add test configs to ContactsProviderTestsDan Shi
Details about test configs changes are tracked in doc https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit# Bug: 35882476 Test: local test Change-Id: If72f63eb55d63f35e51335583ba7ebab7380751b
2017-03-15packages/providers/ContactsProvider: Add APCT tests to the device-tests suite.Simran Basi
This CL adds the APCT tests within this project to a similar suite as CTS known as device-tests. The current method of running APCT tests in the infrastructure is unaffected. Bug: 35882476 Test: `make dist device-tests -j` and local builds of continuous_instrumentation_tests & continuous_native_tests Change-Id: Iff7fed94ed30176930d3e93279b7055053757432
2017-03-13Don't blur less than 10.Makoto Onuki
Bug: 36089513 Test: adb shell am instrument -w com.android.providers.contacts.tests Change-Id: I20c541973cfb4e2cef7b66c5373513e77b208264
2017-03-07Merge "Loosen SQL check"TreeHugger Robot
2017-03-06Loosen SQL checkMakoto Onuki
Bug: 36004581 Test: adb shell am instrument -w com.android.providers.contacts.tests Change-Id: Ifbbb88aff802d9c7cbf107f752996a0506e2a31a
2017-03-06Don't use manifest receiverMakoto Onuki
- Only use a runtime receiver to handle package broadcasts. We still do mostly the same tasks in the receiver. - Also remove the BG service used by the voicemail provider. - When the voicemail provider starts, remove records made by packages that have been uninstalled. - The package receiver was used to update GAL providers too. The previous CL already takes care of scanning GAL providers on startup. Test: adb shell am instrument -w com.android.providers.contacts.tests Bug 35388445 Bug 35385207 Change-Id: I743a769bd51e2acdbd13df1440cce04b35331fda
2017-03-06Rescan all GAL providers when GAL provider packages have...Makoto Onuki
been added or removed at startup. Bug 35388445 Test: adb shell am instrument -w com.android.providers.contacts.tests Change-Id: Ifc8a9498151e5523e3657cd006e7831d68389f67
2017-03-01Merge "Shutdown worker thread when not needed"TreeHugger Robot
2017-02-28Shutdown worker thread when not neededMakoto Onuki
We need to add a couple more handle threads. Before doing so, let's make sure we don't keep worker threads forever. Bug 35388445 Test: adb shell am instrument -e class com.android.providers.contacts.ContactsTaskSchedulerTest -w com.android.providers.contacts.tests Change-Id: I5806e9932ee9141b6a3cf14b457d9b9b785df43c
2017-02-27Sanity check against contact-id = 0Makoto Onuki
Test: adb shell am instrument -w com.android.providers.contacts.tests Bug 35756516 Change-Id: I3627fab41781b9d547f69320ff2519708d81135b
2017-02-22Some cleanup for CP2Makoto Onuki
- Get ContactDirectoryManager's debug flag from sys prop. - Introduce a debug sys prop to all scan directories. - Some clean up for voicemail provider too ContentProvider.getCallingPackage() didn't used to exist, so it has custom code for that. Now we can just use getCallingPackage(). Test: adb shell am instrument -w com.android.providers.contacts.tests Change-Id: Ic16d598251f4bc0bb84b0b71dac2366f195425fe
2017-02-14Merge "Fix VoicemailProviderTest for new columns" into nyc-mr2-dev am: ↵Ta-wei Yen
f097acc609 am: 2b813a55e2 Change-Id: I655012e04a818f6351c56cebdbafe0a141176f3d
2017-02-14Merge "Fix VoicemailProviderTest for new columns" into nyc-mr2-devTa-wei Yen
am: f097acc609 Change-Id: I76aea40cf9905b3db85a3ae04d671376b9e0c6d0
2017-02-14Merge "Fix VoicemailProviderTest for new columns" into nyc-mr2-devandroid-7.1.2_r9android-7.1.2_r8android-7.1.2_r6android-7.1.2_r5android-7.1.2_r4android-7.1.2_r39android-7.1.2_r38android-7.1.2_r37android-7.1.2_r36android-7.1.2_r33android-7.1.2_r32android-7.1.2_r30android-7.1.2_r3android-7.1.2_r29android-7.1.2_r28android-7.1.2_r27android-7.1.2_r25android-7.1.2_r24android-7.1.2_r23android-7.1.2_r2android-7.1.2_r19android-7.1.2_r18android-7.1.2_r17android-7.1.2_r16android-7.1.2_r15android-7.1.2_r14android-7.1.2_r13android-7.1.2_r12android-7.1.2_r11android-7.1.2_r10android-7.1.2_r1nougat-mr2.3-releasenougat-mr2.2-releasenougat-mr2.1-releasenougat-mr2-security-releasenougat-mr2-releasenougat-mr2-pixel-releasenougat-mr2-devTa-wei Yen
2017-01-30Revive CONTACTS_DATABASE_CREATED, and...Makoto Onuki
Remove STATUS_CHANGE_NOTIFICATION_CONTENT_URI. Bug 33390320 Test: adb shell am instrument -w -e size small com.android.providers.contacts.tests Test: adb shell am instrument -w -e size medium com.android.providers.contacts.tests Test: adb shell am instrument -w -e size large com.android.providers.contacts.tests Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsContactsProviderWipe Change-Id: I10052a0682cb4bde0d94f6a22c50d0cff3a253fe
2017-01-25Fix VoicemailProviderTest for new columnsTa-wei Yen
Test: VoicemailProviderTest Bug: 34463609 Change-Id: Ic9c1963f084373f2d69090bee82de3e9f1bb438b
2017-01-20Add voicemail backup/restore columns am: 27bedb2f41Ta-wei Yen
am: 3a4795d738 Change-Id: I921f574f89dc5a72cf0d18a05e20a75568909655
2017-01-20Add voicemail backup/restore columnsTa-wei Yen
am: 27bedb2f41 Change-Id: I54730a8379b0aa85b8a1fd9f5b913b4bc656377a
2017-01-20Merge "Add voicemail backup/restore columns" into nyc-mr2-devTa-wei Yen
2017-01-19Add voicemail backup/restore columnsTa-wei Yen
BACKED_UP and RESTORED are required for dialer voicemail backup/restore feature for N MR2. As there are no API bump the fields will be hidden in NMR2. These fields will be made public in O. ARCHIVED and IS_OMTP_VOICEMAIL is not used for NMR2, but added in advance to avoid multiple database upgrades. Test: VoicemailProviderTest Bug: 34463609 Change-Id: I95ef21950337ca1f8bc79cc0493f7c302ec05617
2017-01-19Merge "Prepare for removal of legacy-test from default targets" am: ↵Paul Duffin
e771ade10d am: 013c7a6515 am: 850c264611 Change-Id: If26ed656c31cdf84b758aff0f3239b09973d09dc
2017-01-19Merge "Prepare for removal of legacy-test from default targets"Paul Duffin
2017-01-18Merge "Add ProviderStatus.DATABASE_CREATION_TIMESTAMP"Makoto Onuki
2017-01-18Prepare for removal of legacy-test from default targetsPaul Duffin
In preparation for removing junit classes from the Android API the legacy-test target will be removed from the TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit dependencies on junit and/or legacy-android-test to ensure that modules will compile properly once it is removed. Bug: 30188076 Test: make checkbuild Change-Id: I1cc80298ffd6402b91227d45f86fd958d589da50
2017-01-18Prepare for removal of legacy-test from default targetsPaul Duffin
In preparation for removing junit classes from the Android API the legacy-test target will be removed from the TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit dependencies on junit and/or legacy-android-test to ensure that modules will compile properly once it is removed. (cherry picked from b7099adc38fd3760f96721e9b3a768e4a5068c97) Bug: 30188076 Test: make checkbuild Merged-In: I1cc80298ffd6402b91227d45f86fd958d589da50 Change-Id: If1c1df5f5132f2d90d3fd932f28425fec505c6d5
2017-01-17Add ProviderStatus.DATABASE_CREATION_TIMESTAMPMakoto Onuki
Also stop sending CONTACTS_DATABASE_CREATED Test: adb shell am instrument -w -e size small com.android.providers.contacts.tests Test: adb shell am instrument -w -e size medium com.android.providers.contacts.tests Test: adb shell am instrument -w -e size large com.android.providers.contacts.tests Bug 33390320 Change-Id: I135fc66aee70d31d0547aa3e8bbcbf3f7ccf514f
2017-01-17Prevent LAST_MODIFIED from changing after deletion am: 687bef960aTa-wei Yen
am: 79733da1e9 Change-Id: I6678fcd89d52a1cd46ace7b6d97b2e24d4b06c96
2017-01-17Prevent LAST_MODIFIED from changing after deletionTa-wei Yen
am: 687bef960a Change-Id: I4ca82707fccd6672f7b0f5f2fb8727da3df8b1fb
2017-01-17Merge "Prevent LAST_MODIFIED from changing after deletion" into nyc-mr2-devTa-wei Yen
2017-01-11Set metadata_dirty Not dirty when there's metadata change.Tingting Wang
Also notifyChange to ContactsContract.AUTHORITY when there 's normal change or metadata change. BUG 34159109 Test: Manual - Made metadata change when metadata_sync is disabled/enabled. Test: adb shell am instrument -w -e size small com.android.providers.contacts.tests Test: adb shell am instrument -w -e size medium com.android.providers.contacts.tests Test: adb shell am instrument -w -e size large com.android.providers.contacts.tests Change-Id: I9e06920f7fb1d2fb024723ec38d6e0683e046577
2016-12-15Fix failing test am: 640e082744Makoto Onuki
am: 70e57ed0a7 Change-Id: Ie62a1184e70b381cd9aee5b6054721095359030c
2016-12-14Fix unit testsMakoto Onuki
(Note this contains MR2 failure, Ica46934c too.) Bug 33589515 Test: adb shell am instrument -w -e size small com.android.providers.contacts.tests Test: adb shell am instrument -w -e size medium com.android.providers.contacts.tests Test: adb shell am instrument -w -e size large com.android.providers.contacts.tests Change-Id: I67af719f60796e3753e67dfd743278953daa2c10
2016-12-14Fix failing testMakoto Onuki
Test: adb shell am instrument -w -e size small com.android.providers.contacts.tests Test: adb shell am instrument -w -e size medium com.android.providers.contacts.tests Test: adb shell am instrument -w -e size large com.android.providers.contacts.tests Bug 33589330 Change-Id: Ica46934cd07c20e6d7b1c8804ebef4e768e10af9
2016-11-08Prevent LAST_MODIFIED from changing after deletionTa-wei Yen
Previously LAST_MODIFIED is updated every time any modification is done to a row, even if it is marked as deleted. A deleted row should not be changed other then undeleting it, but it is hard to enforce this on existing clients. Instead, LAST_MODIFIED will freeze at the moment it was deleted. In this CL, before the values are updated a separate query will update LAST_MODIFIED for all rows that will be affected, unless it is already marked as deleted. If a update will unmark the rows as deleted, a rows will have its' LAST_MODIFIED updated. Fixes: 31975372 Test: runtest contactsprov Note: In the current master most of the contacts provider tests are broken due to UserManager changed to use getApplicationContext() on its' constructor, which is not mocked by the test context. This CL is tested with the change reverted. Change-Id: I7ce1e98fa14932c50e84bb9ef6b2549e93faddc4
2016-10-11Don't expose raw usage stats to clients; return "low-res" values.Makoto Onuki
- "times_used" now return values after the following conversion: value == 0 -> 0 value < 10 -> 1 10 <= value <= 19 -> 10 20 <= value <= 29 -> 20 : : - "last_time_used" now returns values in day granularity. Test: run-all-tests.sh Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check \ com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a \ -m CtsProviderTestCases Bug 31753890 Change-Id: Ief2b93ce7775bb6482c03ceb1ba0fd367d51eed8
2016-10-06Support making a "snapshot" of databases during tests.Makoto Onuki
- We normally use in-memory DBs in unit tests because that's faster. Add a flag to switch to file-based DBs so we can copy them. - Also cleaned up the getDatabaseHelper() methods -- we had two, one with no arguments and the other without, and it wasn't clear which ones should be used when. Now the one that takes a context is renamed to make it clear the distinction. Test: run-all-tests.sh with and without the flag set. Change-Id: I376674a94e35a3314d91813debbeee5b3814f4a9
2016-10-03Add secondary tests that run on separate processMakoto Onuki
- Test all URIs that are supported, and make sure they can be queried. - Removed the URLs that were actually not implemented. - Fix a bug in ProfileAwareUriMatcher Test: run-all-tests.sh Change-Id: I5a898ac44b3a7b22b404f764ae40f00f16d44340
2016-09-30Simplify ContactsDatabaseHelperUpgradeTestMakoto Onuki
Test: adb shell am instrument -w com.android.providers.contacts.tests Change-Id: Ibbae2d6713d83f7a4390e3125853142c13c7fff6
2016-09-29Merge "Report invalid SQL with non-crashing 'wtf' rather than crash"Makoto Onuki
2016-09-28Adding presence tables to upgrade testSuprabh Shukla
Presence tables were missing from the db upgrade test Test: adb shell am instrument -e class 'com.android.providers.contacts.ContactsDatabaseHelperUpgradeTest' -w 'com.android.providers.contacts.tests/android.test.InstrumentationTestRunner' Bug: 28599963 Change-Id: I8b2b62a9c8851da8f4d7f4025c89577a1afed779
2016-09-28Report invalid SQL with non-crashing 'wtf' rather than crashMakoto Onuki
- Also allow the use of "default_directory". Test: unit tests Bug 31801512 Change-Id: I9261c6e71fdd96449c98ef62084cfe0b21419f9a
2016-09-27Merge "Removing mimetype and package cache"TreeHugger Robot
2016-09-27SQL token checker to detect uses of hidden tables/columnsMakoto Onuki
- Detect invalid SQL code (e.g. contains a semi-colon) in not only WHERE for query() but in other places too. - Disallow use of the word "select" and table/view names in the supplied code to prevent subqueries. - This mechanism will be used to hide columns in the futire too. Test: adb shell am instrument -w com.android.providers.contacts.tests Bug 31559073 Change-Id: Ib4293b4caf7e341186ee8bd4cc2d7dad7155c48d
2016-09-26Removing mimetype and package cacheSuprabh Shukla
We need to remove caches since after enabling WAL, we will have writers work in non-exclusive transactions (b/31600627) which might lead to readers reading uncommitted values if the cache is updated and the transaction fails. Test: Added a test testGetCommonMimeTypeIds to test the prepopulated cache for common mimetypes added in this change. Verified that existing tests in ContactsProvider2Test and ContactsDatabaseHelperTest pass. Bug: 31599660 Change-Id: I804ae9e952029a7f1b702347f866cb5e5d951f3e
2016-09-13Merge "Adding column display_name_alt to phone_lookup"TreeHugger Robot
2016-09-09Adding column display_name_alt to phone_lookupSuprabh Shukla
Clients like Dialer have to run a separate query just to get display name alternative. Adding it to the phone lookup projection columns. Bug: 25022549 Change-Id: Ic3d08d096c0b909f7a9a6cb9bd2c137fa4df1191
2016-09-09Merge "Make DbQueryUtils.escapeLikeValue() escape escape chars."Chris Smith