172 Commits

Author SHA1 Message Date
Paul Duffin
ccb0445027 Prepare for removal of legacy-test from default targets
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 6387604f9e672ece85e07c4bcbd7be396867f06f)

Bug: 30188076
Test: make checkbuild
Merged-In: I13e88297731253420e4e5f5291d503f13a39a156
Change-Id: I58446eb8c45d8ac2bcdbc9fa40d1321e811bdd4b
2017-01-19 09:43:05 +00:00
Guang Zhu
1ebd8416ae migrate documents UI tests to use AndroidJUnitRunner
The runner replaces deprecated InstrumentationTestRunner, provides
equivalent functionality, and in addition support JUnit4, sharding
and per test method timeout.

Change-Id: I1c76996d347d3f0f378997f5e7b871279c2b032f
2016-06-06 11:24:31 -04:00
Tomasz Mikolajewski
4759c9f03f Cancel band selection on directory change.
This is a workaround for N. Ideally we should keep the band selection,
as directory may change very often, eg. during loading, or downloading
a file (every second).

Bug: 27224277
Change-Id: I40cfb12c4f7928c4e0d6e675e91ba30ab3a6ab52
2016-04-19 17:51:05 +09:00
Steve McKay
55625a675f Deal gracefully with empty srcs.
Bug: 28184194, 28173827
Change-Id: I6794b147a7e3d3aba73600a87d565bfffe4a4b93
2016-04-14 10:34:08 -07:00
Tomasz Mikolajewski
5e02d303c0 Do not allow to select non-selectable items via mouse.
Bug: 28101625
Change-Id: I9f6cd4e259f7860bbc6c74c4d24c43e2c3ba1047
2016-04-13 06:36:22 +00:00
Steve McKay
53f109b39e Massage code to better support Files overlay.
Also, allow "productivity_mode" config to be enabled via intent extra
    as a developement aide.

Bug: 28006206
Change-Id: I7be8d96a0e924f9ce8023347e051d28d69a0eec9
2016-04-06 10:25:02 -07:00
Aga Wronska
69e852d759 Fix search view tests on handheld devices
Change-Id: If7107e23e93989f040abf7f909b4134b0035b8e4
2016-03-31 13:31:24 -07:00
Aga Wronska
774cc932fc Add menu option to show/hide internal storage.
This reverts commit 7c4395804e450533afb553ab992c47f737da8a9b.

Bug: 27683276
Change-Id: Id1a310b57ab7fa3c8c14b464786473f211eaf41f
2016-03-30 18:23:10 -07:00
Tomasz Mikolajewski
21fece7a32 Merge "Add basic jank tests for DocumentsUI." into nyc-dev 2016-03-29 00:45:32 +00:00
Tomasz Mikolajewski
8ee8ebfa63 Add basic jank tests for DocumentsUI.
This CL adds two jank tests:
* For opening a root (directory) with many files.
* For flinging through a directory with many files.

Bug: 27383277
Change-Id: Ie67efe6d5495ff3a8ed63135ed7ec2d4e6262bd2
2016-03-28 19:27:05 +09:00
Tomasz Mikolajewski
378f409034 Merge "Fix testModelIdIsUnique test in DocumentsUI." into nyc-dev 2016-03-24 00:40:07 +00:00
Tomasz Mikolajewski
d283221426 Fix testModelIdIsUnique test in DocumentsUI.
The logic changed, so the test had to be updated. Basically we support
multiple authorities only for cursors wrapped with MergeCursor.

Bug: 27742039
Change-Id: If07e1bf52279072e408a90efbe838a1d76adfcfd
2016-03-23 16:41:48 +09:00
Tomasz Mikolajewski
007151a90d Reduce memory allocations and improve sorting in DocumentsUI by 8.42%.
Reland after a revert. No changes.

Bug: 27286016
Change-Id: I0988062106faf4086c44d9b344649ef2cb86d3e7
2016-03-18 02:15:10 +00:00
Aga Wronska
b4129d785c Add config flag to hide home directory ("Documents") from the roots list.
Make home root hidden by default.

Change-Id: Ia9f97f3cad7ab102d65e01d6e0dd9bc39ab72f21
Fixed: 27683725
2016-03-17 11:57:29 -07:00
Aga Wronska
f3244e870e Revert "Precompute cursor indexes in DocumentsUI and improve perf by 2.7%."
It ia causing tests failures and exception at the app start.

This reverts commit d35a974b76cb0b3387aff7780d101e3f7de2ebd3.

Change-Id: I2577f723a7e25d4dcc12050791c65a900ac41f7d
2016-03-16 13:49:58 -07:00
Ben Kwa
415c0627b3 Merge "Fix band selection problems." into nyc-dev 2016-03-16 20:06:14 +00:00
Ben Kwa
c29fd8d149 Fix band selection problems.
BUG=27364174
BUG=27645942

Change-Id: Ib14680db708f1ddf1f5dc9dff8b93b655fa3f123
2016-03-16 11:02:48 -07:00
Tomasz Mikolajewski
49ca224623 Reduce memory allocations and improve sorting in DocumentsUI by 8.42%.
Bug: 27286016
Change-Id: Icc84aaaedd396d82f4ca7de63a682deebe1e1b93
2016-03-16 09:59:55 +00:00
Aga Wronska
7e166888ac Suppress tests failing because or permission inconsistency
Bug: 27653930
Change-Id: I92581b8d048af1a207ca8cf56dea40f17f38f42d
2016-03-14 15:10:56 -07:00
Steve McKay
3e63e7de23 Run all downloads through trampoline.
This guarantees the retry/delete support in the downloads
    trampoline can do its thing.
Allow APKs not in downloads to go directly to pakcage
    manager via VIEW intent.
Add test coverage for retry dialog.

Bug: 27539337

Change-Id: I75c5db8915e24a7648c7990136d39ed86d407637
2016-03-11 16:42:51 -08:00
Steve McKay
4064f60831 Merge "Delete downloads activity." into nyc-dev 2016-03-11 00:04:00 +00:00
Steve McKay
2c4c90d246 Merge "Fallback to byte-by-byte copy/move if optimized fails." into nyc-dev 2016-03-10 23:18:51 +00:00
Steve McKay
6ce903d7b7 Delete downloads activity.
Delete "MANAGE_ROOT" activity.
Add intent filter for "BROWSE_DOWNLOADS".
Open by default on Downloads directory.

Bug: 27563427
Change-Id: I1f85dc17a0bc94b439a272847e4ab3bb347ead23
2016-03-10 11:34:03 -08:00
Tomasz Mikolajewski
1008a11233 Fallback to byte-by-byte copy/move if optimized fails.
Sometimes providers may refuse to do a provider-side copy/move
even though the documents had the SUPPORTS_COPY/MOVE flags set.

This is because optimized copy/move may be only supported within
the same root.

Since there is no easy way to check if documents are on the same
roots from DocumentsUI, as well as whether the provider can actually
copy/move efficiently between different roots, we should tolerate the
failure and do a fallback to byte-by-byte operation.

Bug: 27436368
Change-Id: Ia1a0fbdba26c06b2151afc25d8513c01d60d31db
2016-03-10 16:48:29 +09:00
Tomasz Mikolajewski
9ab36aa86e Merge "Improve sorting performance by 2.5 times." into nyc-dev 2016-03-10 00:28:24 +00:00
Steve McKay
f346796b88 Suppress Rename tests that fail consistently...
on APCT.

Change-Id: I81e464855e16573e536828813b592f7ebc5b464f
2016-03-08 13:14:37 -08:00
Steve McKay
cc90976612 Merge "Suppress tests that are consistently failing..." into nyc-dev 2016-03-08 01:38:52 +00:00
Tomasz Mikolajewski
c05d98f64e Improve sorting performance by 2.5 times.
This CL replaces List<String> with String[], which prevents from
calling get() and set() multiple times within a loop, in favor of
System.arraycopy().

Scanning a directory with 10K files went down from 1200ms to 450ms.

Bug: 27286016
Change-Id: Id533480934f739905a845cb0e13fe862e361b3db
2016-03-08 09:26:55 +09:00
Steve McKay
18d3e853cc Suppress tests that are consistently failing...
on APCT.

Change-Id: I3a3a718b8211a5188130aa698322934bf62d81d1
2016-03-07 15:36:14 -08:00
Guang Zhu
c5a511ad0c fix DocumentsUI tests makefile
For instrumentation test apks, it should not statically include
Java libraries that are already present in the app module being
instrumented. They only need to be on classpath during compile
time.

Bug: 26689464
Change-Id: I68d4be95e30ae70bbab23d016a87eb085c10cc50
2016-03-06 00:47:59 +00:00
Steve McKay
8db100e4a3 Merge "Don't show title in delete confirmation." into nyc-dev 2016-03-02 19:56:21 +00:00
Steve McKay
b4672ef6df Merge "Always show intern storage." into nyc-dev 2016-03-02 18:49:28 +00:00
Steve McKay
7c4395804e Always show intern storage.
Only show debug root when devel mode is enabled.
Remove all traces of "advanced".

Bug: 27297398

Change-Id: Ie7e8be282531bd245351d56ababa8ca625c10fd2
2016-03-02 10:47:59 -08:00
Tomasz Mikolajewski
cf057efaff Fix broken tests due to uninitialized roots.
Change-Id: I014657cab86ffa17290ab8990f0adaa6f6451e15
2016-03-02 14:40:43 +09:00
Tomasz Mikolajewski
1a06789959 Merge "Add scaffolds for performance tests of DocumentsUI" into nyc-dev 2016-03-02 05:35:04 +00:00
Tomasz Mikolajewski
ae6d6b494c Add scaffolds for performance tests of DocumentsUI
Bug: 27370274
Change-Id: I14dea1b85cd84c8bb3c0eee27b2954108bfa4f8b
2016-03-02 13:01:11 +09:00
Steve McKay
ea9ec291ed Fix roots filtering for move operations.
Add test coverage for the Downloads case.
This was a regression to my recent cleanup of RootInfo.
Fixed logic to not exclude basically *everything* when a
    directory is in the set of files to be copied.

Bug: 27303346
Change-Id: I4d5608e0d8d95448b027b20107a11a7a5e46d45e
2016-03-02 01:32:30 +00:00
Steve McKay
c8d4e22a72 Don't show title in delete confirmation.
Also, remove "unhide" from Adapter, since it is unused.
Had to add a custom layout because Alert didn't do a
    good job. LOTS of work for a yes/no!

Bug: 27205772
Change-Id: Ic20d73b54fd142287e07402877ac339300b4bbb7
2016-03-01 12:46:29 -08:00
Tomasz Mikolajewski
88d5592ff2 Merge "Remove revealLauncher and revealApp from tests." into nyc-dev 2016-03-01 01:38:52 +00:00
Aga Wronska
95f44e8f8e Merge "Clear selection mode when changing root" into nyc-dev 2016-02-26 21:32:27 +00:00
Aga Wronska
d559743a0d Clear selection mode when changing root
Bug: 27364691, 27142316
Change-Id: I961f3eef67b51a2de999d34edbacd21e4b51c2a4
2016-02-26 13:26:35 -08:00
Steve McKay
7a3b811122 Delete confirmation and notification improvements.
Bug: 27344527, 27347647, 27136182
Change-Id: Ia33f05b449a0bc30704e116287e18094e30382e0
2016-02-25 15:47:16 -08:00
Aga Wronska
b9eeee1543 Launch the activity with the test root opened for tests
to reduce some flakiness and save time used on opening test root over
and over again.

Bug: 27271765
Change-Id: I6fa191ed8e0c7e8e071e4dd17c62aab5db1e23a5
2016-02-24 16:34:43 -08:00
Tomasz Mikolajewski
2b163bd043 Remove revealLauncher and revealApp from tests.
This speeds executing all tests by 3 minutes (from 12min to 8min).

Bug: 27192623
Change-Id: I96eb9edd802f5817ab466332ac4e1bb9106621bd
2016-02-24 18:52:14 +09:00
Aga Wronska
f4b808345d Merge "Add logic for selecting filename in RenameDocumentFragment - different selection for directory. Prevent test from creating directories in Documents folder." into nyc-dev 2016-02-23 19:04:05 +00:00
Aga Wronska
568b3b366c Add logic for selecting filename in RenameDocumentFragment - different selection for directory.
Prevent test from creating directories in Documents folder.

Change-Id: Ib656f8d69cba27b201b5fe67bcb11fa1dec04953
2016-02-23 10:57:09 -08:00
Tomasz Mikolajewski
0fa97e85e4 Cleanup error handling in jobs.
Change-Id: Icf6a7aad1b84dc92285064810776239e93494e38
2016-02-23 10:36:19 +09:00
Steve McKay
cddd034ca7 Merge "Move directory and roots support to own ui bots." into nyc-dev 2016-02-22 20:01:48 +00:00
Steve McKay
b9a20d10c9 Move directory and roots support to own ui bots.
Also...sorry, snowball, don't automatically open folders
    that are created in Files app. Only do this in DocumentsActivity.

Change-Id: I271655fd3566496eced4aaa7a44d5110233150a0
2016-02-22 11:50:34 -08:00
Steve McKay
008e948c3e Undo generalization isDownloads > supportsChildren.
Move root comparison logic into RootInfo.
Move shared string comparison code to Shared.

Change-Id: I3267b496a165ad3cae773783db0e79df2eb118e8
2016-02-18 15:59:52 -08:00