David Hedberg : shell32/tests: Some additional tests for IShellBrowser.
Alexandre Julliard
julliard at winehq.org
Tue Aug 24 11:09:27 CDT 2010
Module: wine
Branch: master
Commit: 008099f618de6157f2686adb7adfed981a90109d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=008099f618de6157f2686adb7adfed981a90109d
Author: David Hedberg <david.hedberg at gmail.com>
Date: Tue Aug 24 10:56:22 2010 +0200
shell32/tests: Some additional tests for IShellBrowser.
---
dlls/shell32/tests/ebrowser.c | 94 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 91 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/tests/ebrowser.c b/dlls/shell32/tests/ebrowser.c
index 788d644..d8f1677 100644
--- a/dlls/shell32/tests/ebrowser.c
+++ b/dlls/shell32/tests/ebrowser.c
@@ -184,9 +184,11 @@ static void test_SB_misc(void)
{
IExplorerBrowser *peb;
IShellBrowser *psb;
+ IUnknown *punk;
HRESULT hr;
HWND retHwnd;
- LONG lres;
+ LRESULT lres;
+ LONG ref;
ebrowser_instantiate(&peb);
hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb);
@@ -227,9 +229,95 @@ static void test_SB_misc(void)
hr = IShellBrowser_SetMenuSB(psb, NULL, NULL, NULL);
ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
+ /***** Before EB::Initialize *****/
+
+ /* ::GetWindow */
+ retHwnd = (HWND)0xDEADBEEF;
+ hr = IShellBrowser_GetWindow(psb, &retHwnd);
+ ok(hr == E_FAIL, "got (0x%08x)\n", hr);
+ ok(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n");
+
+ todo_wine
+ {
+
+ /* ::SendControlMsg */
+ lres = 0xDEADBEEF;
+ hr = IShellBrowser_SendControlMsg(psb, FCW_STATUS, 0, 0, 0, &lres);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ ok(lres == 0, "lres was %ld\n", lres);
+
+ lres = 0xDEADBEEF;
+ hr = IShellBrowser_SendControlMsg(psb, FCW_TOOLBAR, TB_CHECKBUTTON,
+ FCIDM_TB_SMALLICON, TRUE, &lres);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ ok(lres == 0, "lres was %ld\n", lres);
+
+ hr = IShellBrowser_SendControlMsg(psb, FCW_STATUS, 0, 0, 0, NULL);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+
+ hr = IShellBrowser_SendControlMsg(psb, FCW_TREE, 0, 0, 0, NULL);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+
+ hr = IShellBrowser_SendControlMsg(psb, FCW_PROGRESS, 0, 0, 0, NULL);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ }
+
+ /* ::QueryActiveShellView */
+ hr = IShellBrowser_QueryActiveShellView(psb, (IShellView**)&punk);
+ ok(hr == E_FAIL, "got (0x%08x)\n", hr);
+
+ /* Initialize ExplorerBrowser */
+ ebrowser_initialize(peb);
+
+ /***** After EB::Initialize *****/
+
+ /* ::GetWindow */
+ hr = IShellBrowser_GetWindow(psb, &retHwnd);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ ok(GetParent(retHwnd) == hwnd, "The HWND returned is not our child.\n");
+
+ todo_wine
+ {
+ /* ::SendControlMsg */
+ hr = IShellBrowser_SendControlMsg(psb, FCW_STATUS, 0, 0, 0, NULL);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+
+ lres = 0xDEADBEEF;
+ hr = IShellBrowser_SendControlMsg(psb, FCW_TOOLBAR, 0, 0, 0, &lres);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ ok(lres == 0, "lres was %ld\n", lres);
+
+ lres = 0xDEADBEEF;
+ hr = IShellBrowser_SendControlMsg(psb, FCW_STATUS, 0, 0, 0, &lres);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ ok(lres == 0, "lres was %ld\n", lres);
+
+ lres = 0xDEADBEEF;
+ hr = IShellBrowser_SendControlMsg(psb, 1234, 0, 0, 0, &lres);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ ok(lres == 0, "lres was %ld\n", lres);
+
+ /* Returns S_OK */
+ hr = IShellBrowser_SetStatusTextSB(psb, NULL);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+
+ hr = IShellBrowser_ContextSensitiveHelp(psb, FALSE);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+
+ hr = IShellBrowser_EnableModelessSB(psb, TRUE);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+
+ hr = IShellBrowser_SetToolbarItems(psb, NULL, 1, 1);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ }
+
+ hr = IShellBrowser_QueryActiveShellView(psb, (IShellView**)&punk);
+ ok(hr == E_FAIL, "got (0x%08x)\n", hr);
+
IShellBrowser_Release(psb);
- lres = IExplorerBrowser_Release(peb);
- ok(lres == 0, "Got %d\n", lres);
+ IExplorerBrowser_Destroy(peb);
+ ref = IExplorerBrowser_Release(peb);
+ ok(ref == 0, "Got %d\n", ref);
}
static void test_initialization(void)
More information about the wine-cvs
mailing list