shell_dialogs: fix SelectFileDialogMacTest on Mojave
On 10.14, a file selection dialog whose default path doesn't exist will default back to ~/Documents, which breaks this test. To avoid this issue, have this test use /private/var, which is always present. Bug: 892174 Change-Id: I3f50a74566bdc5a3bf4eb14433138e65d1cfe2d5 Reviewed-on: https://chromium-review.googlesource.com/c/1316109 Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org> Cr-Commit-Position: refs/heads/master@{#606493}
This commit is contained in:

committed by
Commit Bot

parent
ad49ada94c
commit
67a3be8ba0
@ -6,6 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/files/file_util.h"
|
||||
#import "base/mac/foundation_util.h"
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/macros.h"
|
||||
@ -442,9 +443,8 @@ TEST_F(SelectFileDialogMacTest, MultipleDialogs) {
|
||||
|
||||
// Verify that the default_path argument is respected.
|
||||
TEST_F(SelectFileDialogMacTest, DefaultPath) {
|
||||
const std::string fake_path = "/fake_directory/filename.txt";
|
||||
FileDialogArguments args(GetDefaultArguments());
|
||||
args.default_path = base::FilePath(FILE_PATH_LITERAL(fake_path));
|
||||
args.default_path = base::GetHomeDir().AppendASCII("test.txt");
|
||||
|
||||
SelectFileWithParams(args);
|
||||
NSSavePanel* panel = GetPanel();
|
||||
|
Reference in New Issue
Block a user