diff options
author | fukino <fukino@chromium.org> | 2015-06-17 02:20:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-17 09:21:17 +0000 |
commit | 4b048c6df930a3e386d688d30a3f0a07d44f168b (patch) | |
tree | 1f1f5f64738b25ed9f7f071878cfb735a146b8fe /ui | |
parent | 6a18ffd1f1e656bba0d905c30fad6b46ec4ffcff (diff) | |
download | chromium_src-4b048c6df930a3e386d688d30a3f0a07d44f168b.zip chromium_src-4b048c6df930a3e386d688d30a3f0a07d44f168b.tar.gz chromium_src-4b048c6df930a3e386d688d30a3f0a07d44f168b.tar.bz2 |
Files.app: Re-enable reversed order in file list.
BUG=498341
TEST=manually
Review URL: https://codereview.chromium.org/1193513002
Cr-Commit-Position: refs/heads/master@{#334796}
Diffstat (limited to 'ui')
-rw-r--r-- | ui/file_manager/file_manager/foreground/js/ui/file_table.js | 10 | ||||
-rw-r--r-- | ui/file_manager/integration_tests/file_manager/sort_columns.js | 149 |
2 files changed, 148 insertions, 11 deletions
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_table.js b/ui/file_manager/file_manager/foreground/js/ui/file_table.js index 6d14b92..79d1c57 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/file_table.js +++ b/ui/file_manager/file_manager/foreground/js/ui/file_table.js @@ -481,16 +481,6 @@ FileTable.decorate = function( }; /** - * @override - */ -FileTable.prototype.sort = function(i) { - this.dataModel.sort(this.columnModel.getId(i), - this.columnModel.getDefaultOrder(i)); - if (this.selectionModel.selectedIndex === -1) - this.list.scrollTop = 0; -}; - -/** * Updates high priority range of list thumbnail loader based on current * viewport. * diff --git a/ui/file_manager/integration_tests/file_manager/sort_columns.js b/ui/file_manager/integration_tests/file_manager/sort_columns.js index 76b5c15..9a0ecb1 100644 --- a/ui/file_manager/integration_tests/file_manager/sort_columns.js +++ b/ui/file_manager/integration_tests/file_manager/sort_columns.js @@ -18,6 +18,22 @@ testcase.sortColumns = function() { ENTRIES.world ]); + var NAME_DESC = TestEntryInfo.getExpectedRows([ + ENTRIES.photos, + ENTRIES.world, + ENTRIES.desktop, + ENTRIES.hello, + ENTRIES.beautiful + ]); + + var SIZE_ASC = TestEntryInfo.getExpectedRows([ + ENTRIES.photos, + ENTRIES.hello, + ENTRIES.desktop, + ENTRIES.beautiful, + ENTRIES.world + ]); + var SIZE_DESC = TestEntryInfo.getExpectedRows([ ENTRIES.photos, ENTRIES.world, @@ -34,6 +50,22 @@ testcase.sortColumns = function() { ENTRIES.desktop ]); + var TYPE_DESC = TestEntryInfo.getExpectedRows([ + ENTRIES.photos, + ENTRIES.desktop, + ENTRIES.hello, + ENTRIES.world, + ENTRIES.beautiful + ]); + + var DATE_ASC = TestEntryInfo.getExpectedRows([ + ENTRIES.photos, + ENTRIES.hello, + ENTRIES.world, + ENTRIES.desktop, + ENTRIES.beautiful + ]); + var DATE_DESC = TestEntryInfo.getExpectedRows([ ENTRIES.photos, ENTRIES.beautiful, @@ -62,6 +94,21 @@ testcase.sortColumns = function() { remoteCall.waitForFiles(appId, NAME_ASC, {orderCheck: true}). then(this.next); }, + // Click the 'Name' again and check the list. + function() { + remoteCall.callRemoteTestUtil('fakeMouseClick', + appId, + ['.table-header-cell:nth-of-type(1)'], + this.next); + }, + function() { + remoteCall.waitForElement(appId, '.table-header-sort-image-desc'). + then(this.next); + }, + function() { + remoteCall.waitForFiles(appId, NAME_DESC, {orderCheck: true}). + then(this.next); + }, // Click the 'Size' column header and check the list. function() { remoteCall.callRemoteTestUtil('fakeMouseClick', @@ -88,6 +135,33 @@ testcase.sortColumns = function() { remoteCall.waitForElement(appId, '#sort-menu-sort-by-size[checked]'). then(this.next); }, + // Click the 'Size' column header again and check the list. + function() { + remoteCall.callRemoteTestUtil('fakeMouseClick', + appId, + ['.table-header-cell:nth-of-type(2)'], + this.next); + }, + function() { + remoteCall.waitForElement(appId, '.table-header-sort-image-asc'). + then(this.next); + }, + function() { + remoteCall.waitForFiles(appId, SIZE_ASC, {orderCheck: true}). + then(this.next); + }, + // 'Size' should still be checked in the sort menu, even when the sort order + // is reversed. + function() { + remoteCall.callRemoteTestUtil('fakeMouseClick', + appId, + ['#sort-button'], + this.next); + }, + function() { + remoteCall.waitForElement(appId, '#sort-menu-sort-by-size[checked]'). + then(this.next); + }, // Click the 'Type' column header and check the list. function() { remoteCall.callRemoteTestUtil('fakeMouseClick', @@ -103,6 +177,33 @@ testcase.sortColumns = function() { remoteCall.waitForFiles(appId, TYPE_ASC, {orderCheck: true}). then(this.next); }, + // Click the 'Type' column header again and check the list. + function() { + remoteCall.callRemoteTestUtil('fakeMouseClick', + appId, + ['.table-header-cell:nth-of-type(4)'], + this.next); + }, + function() { + remoteCall.waitForElement(appId, '.table-header-sort-image-desc'). + then(this.next); + }, + function() { + remoteCall.waitForFiles(appId, TYPE_DESC, {orderCheck: true}). + then(this.next); + }, + // 'Type' should still be checked in the sort menu, even when the sort order + // is reversed. + function() { + remoteCall.callRemoteTestUtil('fakeMouseClick', + appId, + ['#sort-button'], + this.next); + }, + function() { + remoteCall.waitForElement(appId, '#sort-menu-sort-by-type[checked]'). + then(this.next); + }, // Click the 'Date modified' column header and check the list. function() { remoteCall.callRemoteTestUtil('fakeMouseClick', @@ -118,7 +219,22 @@ testcase.sortColumns = function() { remoteCall.waitForFiles(appId, DATE_DESC, {orderCheck: true}). then(this.next); }, - // 'Date modified' should be checked in the sort menu. + // Click the 'Date modified' column header again and check the list. + function() { + remoteCall.callRemoteTestUtil('fakeMouseClick', + appId, + ['.table-header-cell:nth-of-type(5)'], + this.next); + }, + function() { + remoteCall.waitForElement(appId, '.table-header-sort-image-asc'). + then(this.next); + }, + function() { + remoteCall.waitForFiles(appId, DATE_ASC, {orderCheck: true}). + then(this.next); + }, + // 'Date modified' should still be checked in the sort menu. function() { remoteCall.callRemoteTestUtil('fakeMouseClick', appId, @@ -144,6 +260,37 @@ testcase.sortColumns = function() { remoteCall.waitForFiles(appId, NAME_ASC, {orderCheck: true}). then(this.next); }, + // Click the 'Name' again to reverse the order (to descending order). + function() { + remoteCall.callRemoteTestUtil('fakeMouseClick', + appId, + ['.table-header-cell:nth-of-type(1)'], + this.next); + }, + function() { + remoteCall.waitForElement(appId, '.table-header-sort-image-desc'). + then(this.next); + }, + function() { + remoteCall.waitForFiles(appId, NAME_DESC, {orderCheck: true}). + then(this.next); + }, + // Click 'Name' in the sort menu again should get the order back to + // ascending order. + function() { + remoteCall.callRemoteTestUtil('fakeMouseClick', + appId, + ['#sort-menu-sort-by-name'], + this.next); + }, + function() { + remoteCall.waitForElement(appId, '.table-header-sort-image-asc'). + then(this.next); + }, + function() { + remoteCall.waitForFiles(appId, NAME_ASC, {orderCheck: true}). + then(this.next); + }, function() { checkIfNoErrorsOccured(this.next); } |