diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc index 7baadbe023f3f..43a3d0cf3b18a 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc @@ -1119,6 +1119,20 @@ WRAPPED_INSTANTIATE_TEST_CASE_P( TestParameter(NOT_IN_GUEST_MODE, "traverseFolderShortcuts"), TestParameter(NOT_IN_GUEST_MODE, "addRemoveFolderShortcuts"))); +// Slow tests are disabled on debug build. http://crbug.com/327719 +// Fails on official build. http://crbug.com/429294 +// Disabled under MSAN as well. http://crbug.com/468980. +#if !defined(NDEBUG) || defined(OFFICIAL_BUILD) || defined(MEMORY_SANITIZER) +#define MAYBE_SortColumns DISABLED_SortColumns +#else +#define MAYBE_SortColumns SortColumns +#endif +WRAPPED_INSTANTIATE_TEST_CASE_P( + MAYBE_SortColumns, + FileManagerBrowserTest, + ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "sortColumns"), + TestParameter(IN_GUEST_MODE, "sortColumns"))); + INSTANTIATE_TEST_CASE_P( TabIndex, FileManagerBrowserTest, diff --git a/ui/file_manager/integration_tests/file_manager/sort_columns.js b/ui/file_manager/integration_tests/file_manager/sort_columns.js new file mode 100644 index 0000000000000..d024c5fcab06a --- /dev/null +++ b/ui/file_manager/integration_tests/file_manager/sort_columns.js @@ -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); + } + ]); +}; diff --git a/ui/file_manager/integration_tests/file_manager_test_manifest.json b/ui/file_manager/integration_tests/file_manager_test_manifest.json index 76f7c92675fe0..31cd27b199fb7 100644 --- a/ui/file_manager/integration_tests/file_manager_test_manifest.json +++ b/ui/file_manager/integration_tests/file_manager_test_manifest.json @@ -27,6 +27,7 @@ "file_manager/restore_geometry.js", "file_manager/restore_prefs.js", "file_manager/share_dialog.js", + "file_manager/sort_columns.js", "file_manager/suggest_app_dialog.js", "file_manager/tab_index.js", "file_manager/tasks.js",