diff options
author | Ben Lin <linben@google.com> | 2016-07-20 18:24:29 -0700 |
---|---|---|
committer | Ben Lin <linben@google.com> | 2016-07-22 00:44:00 +0000 |
commit | 8c3e68d316b276f853fb484f9035e2c10e8b4a6e (patch) | |
tree | a4986226ada42060988c786f9859f9be1d89009b /packages/DocumentsUI | |
parent | 3f2b42d9d1a4252db6a19aad9b676c74fa1101c4 (diff) |
Attempt at fixing broken tests and regressing performance.
1. testDeleteDocument_Cancel seems to pass far more often than
testDeleteDocument, which always errors out due to not able to find the
menu item. This is to combine the tests so we don't lose coverage, but
also have less noise in APCT until we figure out what's going on.
2. We have regression currently on our jank tests. Per Guang's
suggestion, we are going to try freezing device orientation to see if it
helps.
Bug: 30190207
Change-Id: Ibdfdb75471b3220faaa9e8abef03df489ff185c3
Diffstat (limited to 'packages/DocumentsUI')
-rw-r--r-- | packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java | 9 | ||||
-rw-r--r-- | packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java | 21 |
2 files changed, 18 insertions, 12 deletions
diff --git a/packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java b/packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java index cb2d904c9a9c..9925d5b0c782 100644 --- a/packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java +++ b/packages/DocumentsUI/perf-tests/src/com/android/documentsui/FilesJankPerfTest.java @@ -56,6 +56,10 @@ public class FilesJankPerfTest extends JankTestBase { final Intent intent = new Intent(context, FilesActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mActivity = getInstrumentation().startActivitySync(intent); + try { + device.setOrientationNatural(); + } catch (RemoteException e) { + } } public void tearDownInLoop() { @@ -63,6 +67,11 @@ public class FilesJankPerfTest extends JankTestBase { mActivity.finish(); mActivity = null; } + try { + final UiDevice device = UiDevice.getInstance(getInstrumentation()); + device.unfreezeRotation(); + } catch (RemoteException e) { + } } public void setupAndOpenInLoop() throws Exception { diff --git a/packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java b/packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java index 623f68ae794b..44f417dbdcbd 100644 --- a/packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java +++ b/packages/DocumentsUI/tests/src/com/android/documentsui/FileManagementUiTest.java @@ -67,17 +67,6 @@ public class FileManagementUiTest extends ActivityTest<FilesActivity> { bots.directory.waitForDocument("Kung Fu Panda"); } - public void testDeleteDocument() throws Exception { - bots.directory.clickDocument("file1.png"); - device.waitForIdle(); - bots.main.clickToolbarItem(R.id.menu_delete); - - bots.main.clickDialogOkButton(); - device.waitForIdle(); - - bots.directory.assertDocumentsAbsent("file1.png"); - } - public void testKeyboard_CutDocument() throws Exception { bots.directory.clickDocument("file1.png"); device.waitForIdle(); @@ -111,7 +100,7 @@ public class FileManagementUiTest extends ActivityTest<FilesActivity> { bots.directory.waitForDocument("file1.png"); } - public void testDeleteDocument_Cancel() throws Exception { + public void testDeleteDocument_Cancel_ThenOK() throws Exception { bots.directory.clickDocument("file1.png"); device.waitForIdle(); bots.main.clickToolbarItem(R.id.menu_delete); @@ -119,5 +108,13 @@ public class FileManagementUiTest extends ActivityTest<FilesActivity> { bots.main.clickDialogCancelButton(); bots.directory.waitForDocument("file1.png"); + + device.waitForIdle(); + bots.main.clickToolbarItem(R.id.menu_delete); + + bots.main.clickDialogOkButton(); + device.waitForIdle(); + + bots.directory.assertDocumentsAbsent("file1.png"); } } |