fix files app browser tests that fail if team-drives is enabled in command line flags. |
|||
Issue description
failures:
FolderShortcuts/FilesAppBrowserTest.Test/traverseFolderShortcuts
FolderShortcuts/FilesAppBrowserTest.Test/addRemoveFolderShortcuts
[21120:21120:0604/160001.287263:INFO:CONSOLE(1566)] "Target element for [command="#create-folder-shortcut"]:not([hidden]):not([disabled]) not found.", source: chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/background/js/background_scripts.js (1566)
[21120:21120:0604/160001.289397:INFO:CONSOLE(0)] "[FAIL] [traverseFolderShortcuts]: FAIL (no message)
Error
at Object.handleRequest (extensions::binding:64:27)
at Object.<anonymous> (extensions::binding:374:32)
at Object.<anonymous> (extensions::test:168:18)
at Object.handleRequest (extensions::binding:64:27)
at Object.<anonymous> (extensions::binding:374:32)
at Object.<anonymous> (extensions::test:152:16)
at Object.handleRequest (extensions::binding:64:27)
at Object.<anonymous> (extensions::binding:374:32)
at chrome-extension://oobinhbdbiehknkpbpejbbpdbkdjmoco/file_manager/folder_shortcuts.js:175:17", source: chrome-extension://oobinhbdbiehknkpbpejbbpdbkdjmoco/_generated_background_page.html (0)
[21120:21120:0604/160001.289979:INFO:CONSOLE(0)] "Uncaught (in promise) chrome.test.failure", source: chrome-extension://oobinhbdbiehknkpbpejbbpdbkdjmoco/_generated_background_page.html (0)
../../chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc:669: Failure
Failed
Failed 1 of 1 tests
Stack trace:
#0 0x000001fa634c testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop()
#1 0x000001fa5d29 testing::internal::AssertHelper::operator=()
#2 0x0000014fa1bf file_manager::FileManagerBrowserTestBase::RunTestMessageLoop()
#3 0x0000014f9a01 file_manager::FileManagerBrowserTestBase::StartTest()
#4 0x000004c5c677 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop()
#5 0x00000475e634 ChromeBrowserMainParts::PreMainMessageLoopRunImpl()
#6 0x00000475d43a ChromeBrowserMainParts::PreMainMessageLoopRun()
#7 0x000001b2426a chromeos::ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun()
#8 0x000002caa871 content::BrowserMainLoop::PreMainMessageLoopRun()
#9 0x00000311dc85 content::StartupTaskRunner::RunAllTasksNow()
#10 0x000002ca8fc2 content::BrowserMainLoop::CreateStartupTasks()
#11 0x000002cad055 content::BrowserMainRunnerImpl::Initialize()
#12 0x000002ca6c25 content::BrowserMain()
#13 0x0000045a4ef3 content::RunBrowserProcessMain()
#14 0x0000045a5e7d content::ContentMainRunnerImpl::Run()
#15 0x0000065a2aac service_manager::Main()
#16 0x0000045a3f14 content::ContentMain()
#17 0x000004c5c230 content::BrowserTestBase::SetUp()
#18 0x0000047175b3 InProcessBrowserTest::SetUp()
,
Jun 12 2018
,
Jun 19 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8abaccffc624fc5659af52d1c0432a2fbf8207a8 commit 8abaccffc624fc5659af52d1c0432a2fbf8207a8 Author: Sasha Morrissey <sashab@chromium.org> Date: Tue Jun 19 03:47:35 2018 Fix FolderShortcuts test to select by label Change ShortcutItem to set the 'label' attribute of an element, so that the FolderShortcuts test can select these elements, with a TODO to remove later. This is the fastest way to fix the integration tests to work when team drives is enabled (and the IDs move around). This also makes the tests robust against more directories being added to the top- level tree. Other approaches considered: (1) Add a getIdForTreeElementWithName method to background/js/test_util.js. This doesn't work with waitForElement() since calling it beforehand fails immediately when the element doesn't exist. Adding a waitForElementInTreeWithName() could work, but you would need both methods, and adding waitFor*() methods is a bit tricky to write. (2) Use :nth-child selectors. This doesn't work because shortcuts are added in alphabetical order, meaning new shortcuts added might invalidate previous selectors. So the selectors aren't static. (3) Pass the expected index of the shortcut into each method call. This works for all methods except ones involving Drive, which use a slightly different selector. Also, for methods like removeShortcut(), it's impossible to tell whether the item has been removed (since all the elements shift up by 1, the shortcut at this index is now just the next shortcut in the list). (4) Keep track of the shortcut state in the test, and predict the indexes based on that. This is harder to do, and requires a nontrivial test rewrite. Bug: 849497 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: Id26c559ea893491cf942b19a874fee29bde79534 Reviewed-on: https://chromium-review.googlesource.com/1103434 Reviewed-by: Noel Gordon <noel@chromium.org> Commit-Queue: Sasha Morrissey <sashab@chromium.org> Cr-Commit-Position: refs/heads/master@{#568328} [modify] https://crrev.com/8abaccffc624fc5659af52d1c0432a2fbf8207a8/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js [modify] https://crrev.com/8abaccffc624fc5659af52d1c0432a2fbf8207a8/ui/file_manager/integration_tests/file_manager/folder_shortcuts.js
,
Jun 19 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cf9deb8ef073ae652f04fd67ef476035e5d63a79 commit cf9deb8ef073ae652f04fd67ef476035e5d63a79 Author: Sasha Morrissey <sashab@chromium.org> Date: Tue Jun 19 04:12:30 2018 Change Team Drives check to be asynchronous Without this patch, shouldShowTeamDrives_ calls |callback| synchronously when the --team-drives flag is disabled, and asynchronously if it is enabled. The asynchronous call causes the navigation tree to updated after the appropriate update methods are called, which causes undefined behaviour. This patch moves the check for Team Drives into an asynchronous function called *after* the tree has been synchronously initialized, and simply shows the element if the user has Team Drives (originally, it hid the element, but this means the item may be visible for a split-second. To fix this, it is added as a hidden element by default and then unhidden after the check). This also fixes the existing integration tests to work with the --team-drives flag enabled. Bug: 849497 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: Ie8e174995ca8b16371f32e8ab780f45748fcc55e Reviewed-on: https://chromium-review.googlesource.com/1103983 Commit-Queue: Sasha Morrissey <sashab@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#568336} [modify] https://crrev.com/cf9deb8ef073ae652f04fd67ef476035e5d63a79/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js [modify] https://crrev.com/cf9deb8ef073ae652f04fd67ef476035e5d63a79/ui/file_manager/file_manager/foreground/js/ui/directory_tree_unittest.js
,
Jun 21 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by slangley@chromium.org
, Jun 5 2018