Skip to content

Commit

Permalink
Split & enable save-as redirection test
Browse files Browse the repository at this point in the history
Splits a recently added Files App DLP integration test into the allowed
and blocked tests, as it seems that the original way of doing both in
the single test made it flaky.

Bug: 1394305
Change-Id: Ibe05f736d8783c7f5d392cff9827e2e076602967
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4110714
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Aida Zolic <aidazolic@chromium.org>
Auto-Submit: Aida Zolic <aidazolic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1084867}
  • Loading branch information
Aida Zolic authored and Chromium LUCI CQ committed Dec 19, 2022
1 parent 7bf7be3 commit a98ae55
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/ash/file_manager/file_manager_browsertest.cc
Expand Up @@ -1303,9 +1303,9 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("dlpContextMenuRestrictionDetails").EnableDlp(),
TestCase("saveAsDlpRestrictedDirectory").EnableDlp(),
TestCase("saveAsDlpRestrictedMountableDirectory").EnableDlp(),
TestCase("saveAsNonDlpRestricted").EnableDlp(),
TestCase("saveAsDlpRestrictedRedirectsToMyFiles").EnableDlp(),
TestCase("openDlpRestrictedFile").EnableDlp()));
// TODO(crbug.com/1394305): Re-enable this test
// TestCase("saveAsDlpRestrictedRedirectsToMyFiles").EnableDlp()));

#define FILE_TRANSFER_TEST_CASE(name) \
TestCase(name).EnableFileTransferConnector()
Expand Down
24 changes: 19 additions & 5 deletions ui/file_manager/integration_tests/file_manager/dlp.js
Expand Up @@ -252,14 +252,16 @@ testcase.saveAsDlpRestrictedMountableDirectory = async () => {
};

/**
* Tests that save dialogs are never opened in a DLP blocked volume/directory,
* but rather in the default display root.
* Tests that save dialogs are opened in a requested volume/directory,
* when it's not blocked by DLP.
* This test is an addition to the `saveAsDlpRestrictedRedirectsToMyFiles` test
* case, which assert that if the directory is blocked, the dialog will not be
* opened in the requested path.
*/
testcase.saveAsDlpRestrictedRedirectsToMyFiles = async () => {
testcase.saveAsNonDlpRestricted = async () => {
const cancelButton = '.button-panel button.cancel';

// Add entries to Downloads and Play files.
await addEntries(['local'], [ENTRIES.hello]);
// Add entries to Play files.
await addEntries(['android_files'], BASIC_ANDROID_ENTRY_SET);

const allowedCloser = async (dialog) => {
Expand All @@ -278,6 +280,18 @@ testcase.saveAsDlpRestrictedRedirectsToMyFiles = async () => {
await openAndWaitForClosingDialog(
{type: 'saveFile'}, 'android_files', BASIC_ANDROID_ENTRY_SET,
allowedCloser));
};

/**
* Tests that save dialogs are never opened in a DLP blocked volume/directory,
* but rather in the default display root.
*/
testcase.saveAsDlpRestrictedRedirectsToMyFiles = async () => {
const cancelButton = '.button-panel button.cancel';

// Add entries to Downloads and Play files.
await addEntries(['local'], [ENTRIES.hello]);
await addEntries(['android_files'], BASIC_ANDROID_ENTRY_SET);

// Setup the restrictions.
await sendTestMessage({name: 'setBlockedArc'});
Expand Down

0 comments on commit a98ae55

Please sign in to comment.