From a862b95b4ca05a0ac239e1b3e347c6b55796927f Mon Sep 17 00:00:00 2001 From: Michael Mc Donnell Date: Sun, 19 Sep 2010 12:12:06 +0200 Subject: [PATCH] shell32/tests: SHBrowseForFolder should return new folder pidl. --- dlls/shell32/tests/brsfolder.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/shell32/tests/brsfolder.c b/dlls/shell32/tests/brsfolder.c index 0aebb746134..e9a6e2c849f 100644 --- a/dlls/shell32/tests/brsfolder.c +++ b/dlls/shell32/tests/brsfolder.c @@ -86,6 +86,19 @@ static void CALLBACK make_new_folder_timer_callback(HWND hwnd, UINT uMsg, SetFocus(hwnd); break; case 2: + /* + * The test does not trigger the correct state on Windows. This results + * in the new folder pidl not being returned. The result is as + * expected if the same steps are done manually. + * Sending the down key selects the new folder again which sets the + * correct state. This ensures that the correct pidl is returned. + */ + keybd_event(VK_DOWN, 0, 0, 0); + break; + case 3: + keybd_event(VK_DOWN, 0, KEYEVENTF_KEYUP, 0); + break; + case 4: KillTimer(hwnd, idEvent); /* Close dialog box */ SendMessage(hwnd, WM_COMMAND, IDOK, 0); @@ -141,6 +154,7 @@ static void test_click_make_new_folder_button(void) char test_folder_path[MAX_PATH]; WCHAR test_folder_pathW[MAX_PATH]; CHAR new_folder_path[MAX_PATH]; + CHAR new_folder_pidl_path[MAX_PATH]; char selected_folder[MAX_PATH]; const CHAR title[] = "test_click_make_new_folder_button"; int number_of_folders = -1; @@ -204,6 +218,14 @@ static void test_click_make_new_folder_button(void) || broken(!does_folder_or_file_exist(new_folder_path)) /* W95, W98, XP, W2K3 */, "The new folder did not get the name %s\n", new_folder_name); + /* Dialog should return a pidl pointing to the new folder */ + ok(SHGetPathFromIDListA(pidl, new_folder_pidl_path), + "SHGetPathFromIDList failed for new folder.\n"); + todo_wine ok(strcmp(new_folder_path, new_folder_pidl_path) == 0 + || broken(strcmp(new_folder_path, new_folder_pidl_path) != 0) /* earlier than Vista */, + "SHBrowseForFolder did not return the pidl for the new folder. " + "Expected '%s' got '%s'\n", new_folder_path, new_folder_pidl_path); + /* Remove test folder and any subfolders created in this test */ shfileop.hwnd = NULL; shfileop.wFunc = FO_DELETE; -- 2.11.4.GIT