This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
browser_tests for sorting columns in Files
This adds a test to check that clicking the columns headers in Files resorts the columns in the correct order. It checks for ascending and descending. TEST=browser_tests -gtest_filter="*SortColumns/FileManagerBrowserTest*" BUG=None Review URL: https://codereview.chromium.org/1063453003 Cr-Commit-Position: refs/heads/master@{#324168}
- Loading branch information
dhaddock
authored and
Commit bot
committed
Apr 8, 2015
1 parent
25f89e5
commit aa89c5b
Showing
3 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
186 changes: 186 additions & 0 deletions
186
ui/file_manager/integration_tests/file_manager/sort_columns.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
'use strict'; | ||
|
||
/** | ||
* Tests the order is sorted correctly for each of the columns. | ||
*/ | ||
testcase.sortColumns = function() { | ||
var appId; | ||
|
||
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, | ||
ENTRIES.beautiful, | ||
ENTRIES.desktop, | ||
ENTRIES.hello | ||
]); | ||
|
||
var TYPE_ASC = TestEntryInfo.getExpectedRows([ | ||
ENTRIES.photos, | ||
ENTRIES.beautiful, | ||
ENTRIES.world, | ||
ENTRIES.hello, | ||
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, | ||
ENTRIES.desktop, | ||
ENTRIES.world, | ||
ENTRIES.hello | ||
]); | ||
|
||
StepsRunner.run([ | ||
function() { | ||
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next); | ||
}, | ||
function(inAppId) { | ||
appId = inAppId; | ||
remoteCall.callRemoteTestUtil('fakeMouseClick', | ||
appId, | ||
['.table-header-cell:nth-of-type(1)'], | ||
this.next); | ||
}, | ||
function() { | ||
remoteCall.waitForElement(appId, '.table-header-sort-image-asc'). | ||
then(this.next); | ||
}, | ||
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); | ||
}, | ||
function() { | ||
remoteCall.callRemoteTestUtil('fakeMouseClick', | ||
appId, | ||
['.table-header-cell:nth-of-type(2)'], | ||
this.next); | ||
}, | ||
function() { | ||
remoteCall.waitForElement(appId, '.table-header-sort-image-desc'). | ||
then(this.next); | ||
}, | ||
function() { | ||
remoteCall.waitForFiles(appId, SIZE_DESC, {orderCheck: true}). | ||
then(this.next); | ||
}, | ||
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); | ||
}, | ||
function() { | ||
remoteCall.callRemoteTestUtil('fakeMouseClick', | ||
appId, | ||
['.table-header-cell:nth-of-type(4)'], | ||
this.next); | ||
}, | ||
function() { | ||
remoteCall.waitForElement(appId, '.table-header-sort-image-asc'). | ||
then(this.next); | ||
}, | ||
function() { | ||
remoteCall.waitForFiles(appId, TYPE_ASC, {orderCheck: true}). | ||
then(this.next); | ||
}, | ||
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); | ||
}, | ||
function() { | ||
remoteCall.callRemoteTestUtil('fakeMouseClick', | ||
appId, | ||
['.table-header-cell:nth-of-type(5)'], | ||
this.next); | ||
}, | ||
function() { | ||
remoteCall.waitForElement(appId, '.table-header-sort-image-desc'). | ||
then(this.next); | ||
}, | ||
function() { | ||
remoteCall.waitForFiles(appId, DATE_DESC, {orderCheck: true}). | ||
then(this.next); | ||
}, | ||
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); | ||
}, | ||
function() { | ||
checkIfNoErrorsOccured(this.next); | ||
} | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters