194 Commits

Author SHA1 Message Date
Daisuke Miyakawa
d2145b97fb Clean up codes and remove/modify stale codes/comments.
Internal issue number: 2195990
2009-11-17 17:12:54 +09:00
Daisuke Miyakawa
1b9e2bec63 Split vCard composer into two parts: VCardComposer and VCardBuilder.
As for VCardBuilder, there was a class with the same name, but this implementation is fundamentally different.
This time, VCardBuilder is like StringBuilder. It enables developers to create their own vCard by themselves.

Make Constants public and rename it to VCardConstants.

Internal issue number: 2242528, 2195990
2009-11-17 14:30:17 +09:00
Daisuke Miyakawa
5a1f2d2de0 Rename several files so that readers would not be confused.
Add unit tests around Phone-number handling and fix some bugs.

Internal issue number: 2195990
2009-11-16 16:31:32 +09:00
Daisuke Miyakawa
592988d307 Add unit tests for Japanization and fix several bugs.
Internal issue number: 2195990
2009-11-13 08:33:11 +09:00
Dan Egnor
f18a01c77e Rename [I]DropBox[Service] to [I]DropBoxManager[Service].
Un-hide the DropBoxManager interface, and update the public API accordingly.
2009-11-12 13:58:27 -08:00
Daisuke Miyakawa
0cda591125 Make vCard composer use ContentValues object with non-empty name unless the object is not marked as IS_SUPER_PRIMARY.
Previous change selected the first ContactValues object even when its name fields are all empty.
This time, vCard composer checks the name fields and skip the object withouth valid name.
One exception is the object with IS_SUPER_PRIMARY flag. If IS_SUPER_PRIMARY flag is set, the object will be
selected even when the object does not have valid name.

Add a unit test for this fix.

Internal issue number: 2252304
2009-11-11 10:03:10 +09:00
Daisuke Miyakawa
f2ad61c83d Make vCard exporter check invalid phone numbers and re-format them if needed.
Also add a unit test for the case.

Internal issue number: 2246410
2009-11-10 09:29:04 +09:00
Daisuke Miyakawa
0e983864fc Support vCard format emitted by Windows Mobile 6.5, which contains invalid "VALUE" params and
"AGENT" line.

Internal Issue number: 2247192
2009-11-09 15:34:55 +09:00
jsh
91abf10520 am b90a187d: Merge change Ie994c0e8 into eclair
Merge commit 'b90a187d2cbbedcec87b479c9df7fd45804ad595' into eclair-mr2

* commit 'b90a187d2cbbedcec87b479c9df7fd45804ad595':
  Update CdmaSmsTest unit test.
2009-11-06 13:23:15 -08:00
jsh
1e1c24bed2 Update CdmaSmsTest unit test.
Forgot to do this with previous check in.  Now that calculateLength() has
been fixed to match the actual encoding (ie, doesn't support single-segment
EMS), test case needs to be updated.

Fixes b/2244483
2009-11-06 11:55:19 -08:00
Daisuke Miyakawa
4fe2c57c3c Add tests for Japanization part of vCard.
Fix several bugs around name construction.

Internal issue number: 2195990
2009-11-05 13:47:48 +09:00
Daisuke Miyakawa
26ee0ae9de Make vCard importer handle "PAGER" phone number correctly.
Add tests for it.

Internal issue number: 2239492
2009-11-05 09:44:42 +09:00
Brett Chabot
8742696b0d am c20fc77c: Merge change Iefd4a388 into eclair
Merge commit 'c20fc77c5a2bb8483f2e6e8b4064853804502365' into eclair-mr2

* commit 'c20fc77c5a2bb8483f2e6e8b4064853804502365':
  Suppress flaky test AppCacheTest#testFreeApplicationCacheSomeFiles
2009-11-04 12:05:45 -08:00
Android (Google) Code Review
c20fc77c5a Merge change Iefd4a388 into eclair
* changes:
  Suppress flaky test AppCacheTest#testFreeApplicationCacheSomeFiles
2009-11-04 14:56:14 -05:00
Daisuke Miyakawa
f035b47774 Make test compontent support multiple vCard input.
Internal issue number: 2195990
2009-11-04 21:51:54 +09:00
Daisuke Miyakawa
9db07dd6b5 Make ContentValuesBuilder a separate file.
Internal issue number: 2195990
2009-11-04 09:10:31 +09:00
Daisuke Miyakawa
ed2d7c42fc Introduce ContentValuesBuilder and make tests easier to read.
Internal Issue number: 2195990
2009-11-04 08:35:41 +09:00
Daisuke Miyakawa
66da163d41 Move some useful logic to VCardTestsBase.java
Internal issue number: 2195990
2009-11-03 16:53:58 +09:00
Daisuke Miyakawa
3f16be2061 Enable vCard tests connect both importer/exporter tests.
Fix a bug in ContactStruct.

Internal issue number: 2195990
2009-11-02 15:25:23 +09:00
Brett Chabot
efd4a388d6 Suppress flaky test AppCacheTest#testFreeApplicationCacheSomeFiles
Bug 1840944
2009-10-30 17:45:09 -07:00
Jack Wang
227ba2072d am e8228afb: Merge change I92cdc5ed into eclair
Merge commit 'e8228afb2bd005ae25ce58719f9d678389b26a16' into eclair-mr2

* commit 'e8228afb2bd005ae25ce58719f9d678389b26a16':
  PerformanceCollector: Collect & report perf measurements in key/value form
2009-10-30 17:07:56 -07:00
Daisuke Miyakawa
f5633bc7e2 Fix test breakage in testNickNameV21().
Internal issue number: 2079082
2009-10-29 12:24:26 +09:00
Android (Google) Code Review
3c828e24a9 Merge change I9195a354 into eclair-mr2
* changes:
  Add partial support of Android-specific properties.
2009-10-28 21:54:29 -04:00
Daisuke Miyakawa
837cba33c5 Add partial support of Android-specific properties.
In the near future, all the values which cannot be converted to
vCard property is expressed as "X-ANDROID-CUSTOM" property + MIME_TYPE.

Example (Nick name):
X-ANDROID-CUSTOM:vnd.android.cursor.item/nickname;Nicky;;;;;;;;;;;;;

All the data are stored ordered by its column name ("data1" - "data15").
Currently the code assumes the max num is 15.

Internal Issue number: 2079082
2009-10-29 09:16:31 +09:00
Dan Egnor
952402704a Instead of a raw AIDL interface, give DropBox a Java
interface (android.os.DropBox); move the Binder interface
behind the scenes.  Make DropBoxEntry into DropBox.Entry.
Make it possible to get a dropbox from an (Application)Context
with the usual getSystemService(DROPBOX_SERVICE) type thing.
Update the tests accordingly.
2009-10-28 15:49:11 -07:00
Jack Wang
075997f12e PerformanceCollector: Collect & report perf measurements in key/value form
- Added new functions to PerformanceCollector and PerformanceResultsWriter
- Modified unit tests to test new functionality and fix flakiness reported in
  2218327 and 2118268
- Added PerformanceCollectorTest to small suite
2009-10-28 14:32:05 -07:00
Brett Chabot
622b190c87 am b81df8e3: Merge change I5535bbdf into eclair
Merge commit 'b81df8e3a2f72546508fcdf92adc39cfa2985c56' into eclair-mr2

* commit 'b81df8e3a2f72546508fcdf92adc39cfa2985c56':
  Disable flaky and failing tests.
2009-10-28 11:37:42 -07:00
Daisuke Miyakawa
bb88e3ad56 Move verification code to VCardTestsBase.
Internal Issue number: 2195990, 2079082
2009-10-27 12:52:23 +09:00
Brett Chabot
5535bbdfc8 Disable flaky and failing tests.
Bugs 2118268, 2176089
2009-10-26 17:44:38 -07:00
Daisuke Miyakawa
d263a064f7 Add a test for vCard composer.
Also modify the behavior of vCard composer so that it honer FN than N toward
DISPLAY_NAME.

Internal issuen number: 2195990
2009-10-27 08:10:35 +09:00
Brett Chabot
5f2ae667e8 am 76bb9a36: Merge change I1932e8f8 into eclair
Merge commit '76bb9a363633b5741937ebe58b01a8b2024753b0' into eclair-mr2

* commit '76bb9a363633b5741937ebe58b01a8b2024753b0':
  Disable com.android.unit_tests.HeapTest:testExternalOomeLarge.
2009-10-21 22:21:40 -07:00
Daisuke Miyakawa
54616f3435 Make MockCursor class a part of public SDK.
With this class, external developers will be able to reduce their
redundant work related to testing around ContentProvider/ContentResolver.

Internal Issue number: 2181010
2009-10-22 07:25:02 +09:00
Android (Google) Code Review
2a2805b7fb Merge change Ib3b06fc3 into eclair-mr2
* changes:
  It turns out to be useful to allow enumeration on a per-tag basis, and it's easy to support based on the data structures we have, so add a tag parameter to getNextEvent().
2009-10-20 16:23:01 -04:00
Dan Egnor
b3b06fc39b It turns out to be useful to allow enumeration on a per-tag basis,
and it's easy to support based on the data structures we have, so
add a tag parameter to getNextEvent().
2009-10-20 13:05:17 -07:00
Brett Chabot
1932e8f811 Disable com.android.unit_tests.HeapTest:testExternalOomeLarge.
BUG 2170975
2009-10-19 17:34:33 -07:00
Daisuke Miyakawa
99a0a2cd73 Add tests and fix vCard code.
Now, basic tests are almost ready.

TODO:
- importer test toward multiple vCard input (though it was tested with real usage)
- exporter tests for multiple composition
- tests with non-Ascii
- tests with special types like TYPE_DOCOMO

ISSUE:
In order to fully check the validity of exporter, we may have to develop
some vCard importer which rejects vCard which is valid but a kind of dubious.

Internal Issue Number: 2160039
2009-10-14 16:07:40 -07:00
Dan Egnor
4410ec8f7c Framework-side DropBox service that maintains a size-bounded
queue of data chunks (sort of a blob-oriented logcat).

In the future, this will be coupled with a revised checkin service that
would actually upload this data.
2009-10-13 17:36:19 -07:00
Daisuke Miyakawa
221bc127c4 Add a new TestSuites: VCardTests
Now, the following command is available.
adb shell am instrument -w -e class com.android.unit_tests.vcard.VCardTests com.android.unit_tests/android.test.InstrumentationTestRunner

Internal Issuer number: 2160039
2009-10-12 14:43:30 -07:00
Daisuke Miyakawa
ba2b21bee8 Implement unit tests for vCard exporter, which depends on the sucess in vCard importer.
In order to share the logic between tests for importer and those for exporter,
PropertyNodesVerifier is now a separated class and drastically modified.
Now the class accept "unordered" expected PropertyNode objects, which allows vCard
composer to not care the exact order of each elements.

MockCursor is added, which may be added into the public API in the future, but in
the test directory for now.
Another MockContentProvider is (temporarily) developed so that it can be accepted by
MockContentResolver#addProvider(), which does not allow IContentProvider and its
descendants but only exact ContentProvider, while the original MockContentProvider in
android.test.mock.MockContentProvider implements IContentProvider.

The test development is still on-going, but this test suffices minimal requirement of
vCard tests.

Internal issue number: 2160039
2009-10-12 13:42:42 -07:00
Daisuke Miyakawa
3f15538a32 Rename VCardTest.java to VCardImportTest.java.
Internal issue number: 2160039
2009-10-09 09:43:57 -07:00
Daisuke Miyakawa
5c3e687965 Develop ContentResolver-based unit tests for vCard importer and fix vCard code
along with the tests

Make test code not only check the validity of VCardParser but also check
the validity of the data insertion part of ContactStruct class, using
MockContentResolver/MockContentProvider. With these tests, we are now really sure
vCard side appropriately sends vCard data into the resolver.

Fix ContactStruct so that it properly handles ORG property and TITLE property,
though it still does not see Group information. There's no vCard found which
uses Group and ORG and TITLE in convolted orders...

e.g. Current implementation misinterprets the following case, but we're not sure
whether any exporter emits data in this kind of complicated form...
group2.ORG:ComparyA
group1.ORG:CompanyB
group1.TITLE:TitleForA
group2.TITLE:TitleForB

Expected: CompanyA + TitleForA, CompanyB + TitleForB
Actual: CompanyA + TitleForB, CompanyB + TitleForA

Also change the parser part a little, so that some component can be reused via
the other part of vCard code.

Added several additional files for the tests, which ensures that
- ORG/TITLE properties are handled as we expect.
- PREF is appropriately handled and passed to the resolver as "IS_PRIMARY" flag.
-- We discarded the code which ensures that "IS_PRIMARY" is added to only one
   field in each type, after the local discussion (the duplication or no primary
   state should be handled by the resolver).

Internal Issue number: 2160039
2009-10-08 19:33:33 -07:00
Brett Chabot
b8a4e5f79a Suppress flaky test HeapTest#testOomeLarge.
BUG 2170975
2009-10-06 19:33:24 -07:00
Tammo Spalink
61aac7b377 Add PERIOD char to CDMA address sugar list.
Addresses issue:
http://buganizer/issue?id=2164455
2009-10-05 14:20:06 +08:00
Hung-ying Tyan
865a1bbf36 Remove deprecated VpnType.getDescription(). 2009-09-30 18:39:48 +08:00
johnwang
9c118c80fd Update CID in NeighboringCellInfo
NeighboringCellInfo works in GSM and UMTS network.

In GSM network, the locaiton value is the combination of LAC and CID.

In UMTS network, the locaiton value is PSC code.

NeighboringCellInfo should access and store those two values seperately.

It involves the change of Public API.

1. Add new API getRadioType(), getLac(), and getPsc() to get location info in GSM and UMTS.

2. Deprecate setCid() and NeighboringCellInfo(int cid) because cid is set by interpreting network type.
2009-09-25 12:17:46 -07:00
Tammo Spalink
af8e23fe9e Conditionalized CDMA-specific test.
Addresses issue:
http://b/issue?id=2122045

Change-Id: Ia43e254f0808e1d96cbd240101eee621979e9100
2009-09-24 12:29:16 +08:00
Wei Huang
409308617f fix bug 2134367: failing phone number compare test.
Change-Id: Iccc3b69cd1e4bdb82da48d87d610e4a45ae31601
2009-09-22 21:52:41 -07:00
Daisuke Miyakawa
6a857d957e Fix test for phone number comparation. Now that there are two algorithms, we should consider them in Java layer.
Uguu.

Internal issue number: 2134367
2009-09-21 10:49:44 -07:00
Daniel Sandler
da06e32e4c Fix http://b/2126318 (density test fails due to wrong-size asset stripping)
The density test expects all resources of all densities to be included, but specifying a density for a particular device build kills that. We therefore add all the required densities explicitly to the Makefile to compensate.
2009-09-18 15:12:07 -04:00
Dianne Hackborn
207700d857 Fix issue #2121993: com.android.unit_tests.os.HandlerThreadTest:testHandlerThread is failing
Change-Id: I5f2cc8b39d3f15782e5fbf47015be9f4fa94a65b
2009-09-16 15:10:30 -07:00