Commit 67a3be8b authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

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/1316109Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606493}
parent ad49ada9
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <vector> #include <vector>
#include "base/files/file_util.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -442,9 +443,8 @@ TEST_F(SelectFileDialogMacTest, MultipleDialogs) { ...@@ -442,9 +443,8 @@ TEST_F(SelectFileDialogMacTest, MultipleDialogs) {
// Verify that the default_path argument is respected. // Verify that the default_path argument is respected.
TEST_F(SelectFileDialogMacTest, DefaultPath) { TEST_F(SelectFileDialogMacTest, DefaultPath) {
const std::string fake_path = "/fake_directory/filename.txt";
FileDialogArguments args(GetDefaultArguments()); FileDialogArguments args(GetDefaultArguments());
args.default_path = base::FilePath(FILE_PATH_LITERAL(fake_path)); args.default_path = base::GetHomeDir().AppendASCII("test.txt");
SelectFileWithParams(args); SelectFileWithParams(args);
NSSavePanel* panel = GetPanel(); NSSavePanel* panel = GetPanel();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment