147 Commits

Author SHA1 Message Date
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
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
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
Steve McKay
9a0fc1f680 Merge "Improvements to Copy/Move flow." into nyc-dev 2016-02-17 23:40:58 +00:00
Steve McKay
a6bbeab1d3 Improvements to Copy/Move flow.
- Always open drawer for copy/move operations.
- Set title to match operation.
- Update button to say "move" for move operations.
- Other minor fixes.

Also fix "Home" tests broken by ag/867110

Bug: 26506479
Change-Id: I3ccb4ddc72be0a21b91744bcb610c1ca490ac30c
2016-02-17 15:39:58 -08:00
Steve McKay
30551a257c Guard against NPE in equals checks.
Update State test to cover different conditions separately.
Update DirectoryInfo test to best practices.
Update RootInfo to follow DirectoryInfo equals pattern.
Also, allow null cursors from Model...since they happen...I seen it mahself.

Bug: 27118725
Change-Id: Id0a0be053b91c887a745bfca5416e64f0edba995
2016-02-17 12:35:51 -08:00
Aga Wronska
c4524a97c4 Merge "Fix Rename Document tests" into nyc-dev 2016-02-13 00:57:24 +00:00
Aga Wronska
5784996fdc Fix Rename Document tests
Bug:27109148
Change-Id: I489b2bd25f92ebc2b9b84d9cefe1f785a89c89ff
2016-02-12 16:53:52 -08:00
Ben Kwa
83df50f997 Allow multiple range selections using the shift key.
- Introduce an API on MultiSelectManager for starting/ending range
  selections.

- Navigation with the shift key pressed extends the current range
  selection (or starts a new one, if one isn't in progress).

- Navigation without the shift key pressed will end the current range
  selection.

BUG=27124371

Change-Id: Ieddf3ee816812bf5210463536fe63179ef1809ad
(cherry picked from commit 09792ef1506f4cbd944e16651508be435d92c5be)
2016-02-11 21:01:04 +00:00
Ben Kwa
2036dad877 Introduce ChromeOS-style keyboard navigation.
- Turn the DirectoryFragment (DF) and the RootsFragment (RF) into
  top-level views, and allow switching between them via the tab key.

- Disallow arrow-key navigation from switching the user between the
  DF and RF.

- When nothing is explicitly focused, make navigation keys focus the
  DF.  This makes it so that if a user opens DocumentsUI and just starts
  pressing arrow keys, they'll navigate in the directory listing.

- When restoring focus on the DF and RF, remember the last thing that
  was focused, and restore focus on that thing.

BUG=25195767
BUG=25121367

Change-Id: I00e20cbdbe9edfe269fb356440a93ef5d67c5298
(cherry picked from commit 1c9f9222e56482682461013b703590c5c9471018)
2016-02-11 14:16:04 +00:00
Steve McKay
e852d93e1d Preserve selection across device rotation.
Also, update Selection model to use a discrete provisional selection,
   rather than a superset "total" selection

Bug: 27075323
Change-Id: I855e6b66010b3cdd599cc0a9f0046a7efadca5fe
2016-02-09 18:52:45 -08:00
Tomasz Mikolajewski
65d9a51afa Fix flakiness of testFilesList_LiveUpdate.
Change-Id: I87618d5640e2e17de3188554d561abc5f3a3152a
(cherry picked from commit 1008c2d4878abde1890560ef48eec229a4253445)
2016-02-10 02:11:37 +00:00
Steve McKay
40d5d9d827 Merge "Don't apply fancy back logic when drawer is not present." into nyc-dev 2016-02-10 02:00:38 +00:00
Aga Wronska
3b5a29cb5d Merge "Go to root from child directory when root tapped. Bug: 27060001" into nyc-dev 2016-02-09 23:58:42 +00:00
Steve McKay
9146ac608c Don't apply fancy back logic when drawer is not present.
Add test coverage. Booya!

Bug: 27078649
Change-Id: Id2ce53009ee212b3af8d143091859d30e2bc76b1
2016-02-09 14:47:50 -08:00
Tomasz Mikolajewski
df3abce378 Remove temporary test fixes.
The tests should fail, as the features are broken.

Change-Id: Ib760ba5469164b8ca0d08c57f24273268ae2436f
(cherry picked from commit 94eca73fec7aa1857f5847df355877d523d0c8a6)
2016-02-09 09:14:49 +00:00
Tomasz Mikolajewski
c7b832202a Migrate all tests to ActivityTest.
ActivityInstrumentationTestCase2 takes care of starting and closing
the activity, which prevents flakyness.

Change-Id: I2d3908f6605a67a3c2d11e18a9c4799443828df9
(cherry picked from commit e366886c7d91b62fe1478a057fc4c0a104d12b02)
2016-02-09 01:42:50 +00:00
Aga Wronska
e436f94f0e Go to root from child directory when root tapped.
Bug: 27060001

Change-Id: Iabe1f9f2c986904a4d827e74cf29b3de55e74f90
(cherry picked from commit 5652d175fedc87c796de3cfd354a9de961450690)
2016-02-08 23:38:07 +00:00
Steve McKay
f8d898590b Honor javadocs, call super first in DocumentsProvider.call handling.
Change-Id: Ic7d8d629c4c7df39ce3e2524670169752bab899b
2016-02-04 10:05:52 -08:00
Tomasz Mikolajewski
24586893ba Migrate *ActivityUiTest to use ActivityInstrumentationTestCase2.
Change-Id: I24f2846c551e0123ad87b3db8a1f5c7dbf628c0c
2016-02-04 15:06:35 +09:00
Tomasz Mikolajewski
1c0b2326b8 Fix flaky testLoadsHomebyDefault.
The test was resuming a previously opened activity, so naturally the
redirect to Home didn't happen.

This CL fixes the issue by closing the activity in TearDown().

Change-Id: I43e78a83c2b53c52745bc7eef515a8f759559e46
2016-02-04 11:50:45 +09:00
Tomasz Mikolajewski
ccda74f5ec Merge "Fix flaky testFilesList_LiveUpdate()." 2016-02-03 02:08:15 +00:00
Aga Wronska
7592987761 Merge "Add tests for action bar's search icon behavior - Icon hidden when root doesn't support search - Icon visible whan root supports search" 2016-02-02 23:46:12 +00:00
Ben Kwa
3182a92a16 Merge "Refactor key handling and selection." 2016-02-02 21:36:39 +00:00
Ben Kwa
6792489dc4 Refactor key handling and selection.
- Pull key handling code out of the MultiSelectManager.

- Tighten up the semantics around range selection:
  - Create an API on MultiSelectManager for handling multi-select.
  - Make the range selection more opinionated (e.g. more state checks),
    to simplify the design and code.

BUG=25195767

Change-Id: I4bbe446ed3059150499db3d28e581b2e68405266
2016-02-02 10:34:19 -08:00
Tomasz Mikolajewski
b005e14e46 Fix flaky testFilesList_LiveUpdate().
Change-Id: I76fe7977c47f7b225ec42d64484942ce059b91fd
2016-02-02 19:26:09 +09:00
Aga Wronska
cfba4f6809 Add tests for action bar's search icon behavior
- Icon hidden when root doesn't support search
    - Icon visible whan root supports search

Bug: 26903635
Change-Id: I7a73d44e83c87be7d25abe55477fa54572833e32
2016-02-01 17:16:44 -08:00
Aga Wronska
0950df196f Add tests for rename documents feature
- Add helper class for the Ui tests. It creates basic test environment.
      It is intermediate layer between UiBot/DocumentsProviderHelper and UiTest classes.
    - Refactor SearchView tests
    - Add renaming support in the test DocumentsProvider
    - Add renaming tests

Bug=26799799

Change-Id: I2849913a1addabff0087bb06b80f36de7cb144f3
2016-02-01 10:36:02 -08:00