Skip to content

Cherry-pick Hide FileSavePicker.SuggestedSaveFilePath #5664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ namespace Microsoft.Windows.Storage.Pickers
Windows.Foundation.Collections.IMap<String, Windows.Foundation.Collections.IVector<String> > FileTypeChoices{ get; };
String DefaultFileExtension;
String SuggestedFileName;
String SuggestedSaveFilePath;

[remote_sync] Windows.Foundation.IAsyncOperation<PickFileResult> PickSaveFileAsync();
}
Expand Down
6 changes: 6 additions & 0 deletions test/StoragePickersTests/PickerCommonTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ namespace Test::PickerCommonTests

}

/*
TEST_METHOD(VerifyConfigureFileSaveDialog_WhenSuggestedSaveFilePathFolderDeleted_ExpectItsFileNameStillWork)
{
// Arrange.
Expand Down Expand Up @@ -124,6 +125,7 @@ namespace Test::PickerCommonTests
// Even the empty file name of SuggestedSaveFilePath takes precedence over SuggestedFileName.
VERIFY_IS_NULL(dialogFileName, L"The save dialog's file name should be empty.");
}
*/

TEST_METHOD(VerifyFilters_FileOpenPickerWhenFileTypeFiltersDefinedExpectAddingUnionedType)
{
Expand Down Expand Up @@ -277,6 +279,7 @@ namespace Test::PickerCommonTests
VERIFY_ARE_EQUAL(L"MyFile1.txt", std::wstring(fileName.get()));
}

/*
TEST_METHOD(VerifyFileSaveDialog_SuggestedSaveFilePathTakesPrecedenceOverSuggestedFileName)
{
// Arrange.
Expand All @@ -299,6 +302,7 @@ namespace Test::PickerCommonTests
dialog->GetFileName(fileName.put());
VERIFY_ARE_EQUAL(L"MyFile2.txt", std::wstring(fileName.get()));
}
*/

TEST_METHOD(VerifyParseFolderItemAndFileName)
{
Expand Down Expand Up @@ -601,6 +605,7 @@ namespace Test::PickerCommonTests
}
}

/*
TEST_METHOD(VerifyValidateSuggestedSaveFilePath)
{
// Arrange.
Expand Down Expand Up @@ -644,6 +649,7 @@ namespace Test::PickerCommonTests
}
}
}
*/

std::vector<std::tuple<winrt::hstring, bool>> file_extension_validation_test_cases{
{L".txt", true},
Expand Down
6 changes: 3 additions & 3 deletions test/StoragePickersTests/StoragePickersTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ namespace Test::StoragePickersTests
picker.SuggestedStartLocation(winrt::Microsoft::Windows::Storage::Pickers::PickerLocationId::DocumentsLibrary);
VERIFY_ARE_EQUAL(picker.SuggestedStartLocation(), winrt::Microsoft::Windows::Storage::Pickers::PickerLocationId::DocumentsLibrary);

std::filesystem::remove_all(L"C:\\temp_filesavepicker_ut_temp");
picker.SuggestedSaveFilePath(L"C:\\temp_filesavepicker_ut_temp\\MyFile.txt");
VERIFY_ARE_EQUAL(picker.SuggestedSaveFilePath(), L"C:\\temp_filesavepicker_ut_temp\\MyFile.txt");
// std::filesystem::remove_all(L"C:\\temp_filesavepicker_ut_temp");
// picker.SuggestedSaveFilePath(L"C:\\temp_filesavepicker_ut_temp\\MyFile.txt");
// VERIFY_ARE_EQUAL(picker.SuggestedSaveFilePath(), L"C:\\temp_filesavepicker_ut_temp\\MyFile.txt");

picker.CommitButtonText(L"commit");
VERIFY_ARE_EQUAL(picker.CommitButtonText(), L"commit");
Expand Down