* On Tue, 2 Aug 2005, Jacek Caban wrote:
--- dlls/mshtml/tests/htmldoc.c 26 Jul 2005 10:31:23 -0000 1.5 +++ dlls/mshtml/tests/htmldoc.c 1 Aug 2005 22:33:37 -0000 @@ -806,12 +806,76 @@ static void test_Persist() } }
+static OLECMDF expect_cmds[OLECMDID_GETPRINTTEMPLATE+1] = {
- 0,
- OLECMDF_SUPPORTED, /* OLECMDID_OPEN */
- OLECMDF_SUPPORTED, /* OLECMDID_NEW */
- OLECMDF_SUPPORTED, /* OLECMDID_SAVE */
...
OLECMD cmd[2] = {
{OLECMDID_OPEN, 0xf0f0},
{OLECMDID_GETPRINTTEMPLATE+1, 0xf0f0}
};
hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 0, NULL, NULL);
ok(hres == S_OK, "QueryStatus failed: %08lx\n", hres);
hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmd, NULL);
ok(hres == OLECMDERR_E_NOTSUPPORTED,
"QueryStatus failed: %08lx, expected OLECMDERR_E_NOTSUPPORTED\n", hres);
Jacek, OLECMDID_OPEN (equally as OLECMDID_NEW) isn't supported here on winME, AFAICT. Moreover, calls to IOleCommandTarget_QueryStatus throws an exception of Accesss Violation here. I tested this with OLECMDID_SAVE and it works OK.
And we have a typo next, right?
ok(cmd[1].cmdf == 0, "cmd[0].cmdf=%lx, expected 0\n", cmd[0].cmdf);
ok(cmd[0].cmdf == OLECMDF_SUPPORTED,
"cmd[1].cmdf=%lx, expected OLECMDF_SUPPORTED\n", cmd[1].cmdf);
Hence, there goes my try:
Log message: Saulius Krasuckas saulius.krasuckas@ieee.org Fix typo in a two checks. WinME fixes: - OLECMDID_OPEN and OLECMDID_NEW aren't supported. - Ignore unsupported OLECMDs as they throws exceptions.
Index: dlls/mshtml/tests/htmldoc.c =================================================================== RCS file: /home/wine/wine/dlls/mshtml/tests/htmldoc.c,v retrieving revision 1.7 diff -p -u -r1.7 htmldoc.c --- dlls/mshtml/tests/htmldoc.c 3 Aug 2005 21:26:40 -0000 1.7 +++ dlls/mshtml/tests/htmldoc.c 13 Aug 2005 16:09:15 -0000 @@ -808,8 +808,8 @@ static void test_Persist()
static const OLECMDF expect_cmds[OLECMDID_GETPRINTTEMPLATE+1] = { 0, - OLECMDF_SUPPORTED, /* OLECMDID_OPEN */ - OLECMDF_SUPPORTED, /* OLECMDID_NEW */ + 0, /* OLECMDID_OPEN */ + 0, /* OLECMDID_NEW */ OLECMDF_SUPPORTED, /* OLECMDID_SAVE */ OLECMDF_SUPPORTED|OLECMDF_ENABLED, /* OLECMDID_SAVEAS */ OLECMDF_SUPPORTED, /* OLECMDID_SAVECOPYAS */ @@ -842,7 +842,7 @@ static const OLECMDF expect_cmds[OLECMDI OLECMDF_SUPPORTED, /* OLECMDID_SHOWPAGESETUP */ OLECMDF_SUPPORTED, /* OLECMDID_SHOWPRINT */ 0,0, - OLECMDF_SUPPORTED, /* OLECMDID_CLOSE */ + OLECMDF_SUPPORTED, /* OLECMDID_DONTDOWNLOADCSS */ 0,0,0, OLECMDF_SUPPORTED, /* OLECMDID_SETPRINTTEMPLATE */ OLECMDF_SUPPORTED /* OLECMDID_GETPRINTTEMPLATE */ @@ -854,7 +854,10 @@ static void test_OleCommandTarget(IOleCo int i; HRESULT hres;
+ ZeroMemory(cmds, sizeof(cmds)); + for(i=0; i<OLECMDID_GETPRINTTEMPLATE; i++) { + if(!expect_cmds[i+1]) continue; cmds[i].cmdID = i+1; cmds[i].cmdf = 0xf0f0; } @@ -863,6 +866,7 @@ static void test_OleCommandTarget(IOleCo ok(hres == S_OK, "QueryStatus failed: %08lx\n", hres);
for(i=0; i<OLECMDID_GETPRINTTEMPLATE; i++) { + if(!expect_cmds[i+1]) continue; ok(cmds[i].cmdID == i+1, "cmds[%d].cmdID canged to %lx\n", i, cmds[i].cmdID); ok(cmds[i].cmdf == expect_cmds[i+1], "cmds[%d].cmdf=%lx, expected %x\n", i+1, cmds[i].cmdf, expect_cmds[i+1]); @@ -961,7 +965,7 @@ static void test_HTMLDocument(void) int i;
OLECMD cmd[2] = { - {OLECMDID_OPEN, 0xf0f0}, + {OLECMDID_SAVE, 0xf0f0}, {OLECMDID_GETPRINTTEMPLATE+1, 0xf0f0} };
@@ -973,9 +977,9 @@ static void test_HTMLDocument(void) "QueryStatus failed: %08lx, expected OLECMDERR_E_NOTSUPPORTED\n", hres); ok(cmd[1].cmdID == OLECMDID_GETPRINTTEMPLATE+1, "cmd[0].cmdID=%ld, expected OLECMDID_GETPRINTTEMPLATE+1\n", cmd[0].cmdID); - ok(cmd[1].cmdf == 0, "cmd[0].cmdf=%lx, expected 0\n", cmd[0].cmdf); + ok(cmd[1].cmdf == 0, "cmd[1].cmdf=%lx, expected 0\n", cmd[1].cmdf); ok(cmd[0].cmdf == OLECMDF_SUPPORTED, - "cmd[1].cmdf=%lx, expected OLECMDF_SUPPORTED\n", cmd[1].cmdf); + "cmd[0].cmdf=%lx, expected OLECMDF_SUPPORTED\n", cmd[0].cmdf);
hres = IOleCommandTarget_QueryStatus(cmdtrg, &IID_IHTMLDocument2, 2, cmd, NULL); ok(hres == OLECMDERR_E_UNKNOWNGROUP,
* On Sun, 14 Aug 2005, Saulius Krasuckas wrote:
- On Tue, 2 Aug 2005, Jacek Caban wrote:
hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 0, NULL, NULL);
ok(hres == S_OK, "QueryStatus failed: %08lx\n", hres);
hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmd, NULL);
ok(hres == OLECMDERR_E_NOTSUPPORTED,
"QueryStatus failed: %08lx, expected OLECMDERR_E_NOTSUPPORTED\n", hres);
Jacek, OLECMDID_OPEN (equally as OLECMDID_NEW) isn't supported here on winME, AFAICT. Moreover, calls to IOleCommandTarget_QueryStatus throws an exception of Accesss Violation here.
Oh. I mean the last call to IOleCommandTarget_QueryStatus, where both cmd elements are used. The first call works OK.
Hello.
Saulius Krasuckas wrote:
- On Tue, 2 Aug 2005, Jacek Caban wrote:
--- dlls/mshtml/tests/htmldoc.c 26 Jul 2005 10:31:23 -0000 1.5 +++ dlls/mshtml/tests/htmldoc.c 1 Aug 2005 22:33:37 -0000 @@ -806,12 +806,76 @@ static void test_Persist() } }
+static OLECMDF expect_cmds[OLECMDID_GETPRINTTEMPLATE+1] = {
- 0,
- OLECMDF_SUPPORTED, /* OLECMDID_OPEN */
- OLECMDF_SUPPORTED, /* OLECMDID_NEW */
- OLECMDF_SUPPORTED, /* OLECMDID_SAVE */
...
OLECMD cmd[2] = {
{OLECMDID_OPEN, 0xf0f0},
{OLECMDID_GETPRINTTEMPLATE+1, 0xf0f0}
};
hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 0, NULL, NULL);
ok(hres == S_OK, "QueryStatus failed: %08lx\n", hres);
hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmd, NULL);
ok(hres == OLECMDERR_E_NOTSUPPORTED,
"QueryStatus failed: %08lx, expected OLECMDERR_E_NOTSUPPORTED\n", hres);
Jacek, OLECMDID_OPEN (equally as OLECMDID_NEW) isn't supported here on winME, AFAICT. Moreover, calls to IOleCommandTarget_QueryStatus throws an exception of Accesss Violation here. I tested this with OLECMDID_SAVE and it works OK.
And we have a typo next, right?
Right, good catch.
ok(cmd[1].cmdf == 0, "cmd[0].cmdf=%lx, expected 0\n", cmd[0].cmdf);
ok(cmd[0].cmdf == OLECMDF_SUPPORTED,
"cmd[1].cmdf=%lx, expected OLECMDF_SUPPORTED\n", cmd[1].cmdf);
Hence, there goes my try:
Log message: Saulius Krasuckas saulius.krasuckas@ieee.org Fix typo in a two checks. WinME fixes: - OLECMDID_OPEN and OLECMDID_NEW aren't supported.
- Ignore unsupported OLECMDs as they throws exceptions.
I'm not sure if it is a correct fix. Although it avoids crashes, much less functionality of QueryStatus is tested. Before your patch all possible commands were tested. But that's not why the patch may be not correct: it seems to be a case similar to crashes on xp while HTMLDocument is not active in place. In this case it is not active in place because UIActivate fails. Looking at the test results, UIActivate is a problem on every win 9x and causes most tests to fail. So first UIActivate should be fixed and then, if this problem remains, we'll be sure that your fix is correct. Presently if you want to make this test not to crash, you may disable IOleCommand tests if UIActivate fails. I'll take a look at these tests, but first I'll have to get win 98 installed. My guess is that it requires to be loaded before a call to UIActivate, so the attached patch might help (even if so, a few other tests will fail, but currently the most interesting is UIActivate), but I haven't tested it yet. Anyway a similar test will go to the CVS soon.
Thanks, Jacek
Index: dlls/mshtml/tests/htmldoc.c =================================================================== RCS file: /home/wine/wine/dlls/mshtml/tests/htmldoc.c,v retrieving revision 1.7 diff -u -p -r1.7 htmldoc.c --- dlls/mshtml/tests/htmldoc.c 3 Aug 2005 21:26:40 -0000 1.7 +++ dlls/mshtml/tests/htmldoc.c 14 Aug 2005 13:25:08 -0000 @@ -43,6 +43,9 @@ ok(called_ ## func, "expected " #func "\n"); \ expect_ ## func = called_ ## func = FALSE
+static const WCHAR WINEHQ_URL[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.', + 'o','r','g','/',0}; + static IUnknown *htmldoc_unk = NULL; static IOleDocumentView *view = NULL; static HWND container_hwnd = NULL, hwnd = NULL, last_hwnd = NULL; @@ -776,6 +779,7 @@ static void test_Persist() { IPersistMoniker *persist_mon; IPersistFile *persist_file; + IMoniker *mon; GUID guid; HRESULT hres;
@@ -801,6 +805,16 @@ static void test_Persist() hres = IPersistMoniker_GetClassID(persist_mon, &guid); ok(hres == S_OK, "GetClassID failed: %08lx\n", hres); ok(IsEqualGUID(&CLSID_HTMLDocument, &guid), "guid != CLSID_HTMLDocument\n"); + + hres = CreateURLMoniker(NULL, WINEHQ_URL, &mon); + ok(hres == S_OK, "CreateURLMoniker failed: %08lx\n", hres); + + if(SUCCEEDED(hres)) { + hres = IPersistMoniker_Load(persist_mon, FALSE, mon, NULL, 0x12); + ok(hres == S_OK, "Load failed: %08lx\n", hres); + + IMoniker_Release(mon); + }
IPersistMoniker_Release(persist_mon); }
* On Sun, 14 Aug 2005, Jacek Caban wrote:
I'm not sure if it is a correct fix. Although it avoids crashes, much less functionality of QueryStatus is tested. Before your patch all possible commands were tested.
This is true only for nt family windows. :-P On 9x test function exits on an exception.
it seems to be a case similar to crashes on xp while HTMLDocument is not active in place. In this case it is not active in place because UIActivate fails. Looking at the test results, UIActivate is a problem on every win 9x and causes most tests to fail. So first UIActivate should be fixed and then, if this problem remains, we'll be sure that your fix is correct.
I don't understand much in all this OLE/In-Place stuph, so I agree, but still I doubt this would be a sufficient to proof my patch is correct. :-]
Presently if you want to make this test not to crash, you may disable IOleCommand tests if UIActivate fails.
I will try, but what should be done with this (inside test_HTMLDocument)?
| OLECMD cmd[2] = { | {OLECMDID_OPEN, 0xf0f0}, | {OLECMDID_GETPRINTTEMPLATE+1, 0xf0f0} | }; | | hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmd, NULL); | ok(hres == OLECMDERR_E_NOTSUPPORTED, | "QueryStatus failed: %08lx, expected OLECMDERR_E_NOTSUPPORTED\n", hres);
Or IOW, why first call generates exception on OLECMDID_OPEN command while second do not?
| hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmd, NULL); | hres = IOleCommandTarget_QueryStatus(cmdtrg, &IID_IHTMLDocument2, 2, cmd, NULL);
OLECMDID_OPEN seems to be supported at least on winME. I am curious, why?
My guess is that it requires to be loaded before a call to UIActivate,
What do you exactly mean by "it"?
so the attached patch might help (even if so, a few other tests will fail, but currently the most interesting is UIActivate),
No, the patch didn't help.
* On Sun, 14 Aug 2005, Saulius Krasuckas wrote:
- On Sun, 14 Aug 2005, Jacek Caban wrote:
Presently if you want to make this test not to crash, you may disable IOleCommand tests if UIActivate fails.
Is something like this OK? I have "borrowed" boolean variable expect_SetActiveObject_active.
| --- dlls/mshtml/tests/htmldoc.c 2005-08-14 19:33:22.000000000 +0300 | +++ /mnt/vcd2/wine/dlls/mshtml/tests/htmldoc.c 2005-08-14 19:22:26.000000000 +0300 | @@ -510,8 +510,8 @@ static HRESULT WINAPI DocumentSite_Activ | SET_EXPECT(OnUIActivate); | SET_EXPECT(SetActiveObject); | SET_EXPECT(ShowUI); | - expect_SetActiveObject_active = TRUE; | hres = IOleDocumentView_UIActivate(view, TRUE); | + expect_SetActiveObject_active = (hres == S_OK); | ok(hres == S_OK, "UIActivate failed: %08lx\n", hres); | CHECK_CALLED(CanInPlaceActivate); | CHECK_CALLED(GetWindowContext); | @@ -957,7 +957,7 @@ static void test_HTMLDocument(void) | CHECK_CALLED(ActivateMe); | } | | - if(cmdtrg) { | + if(cmdtrg && expect_SetActiveObject_active) { | int i; | | OLECMD cmd[2] = { | @@ -1020,7 +1020,7 @@ static void test_HTMLDocument(void) | CHECK_CALLED(OnUIDeactivate); | } | | - if(cmdtrg) | + if(cmdtrg && expect_SetActiveObject_active) | test_OleCommandTarget(cmdtrg); | | if(activeobject) { | @@ -1129,7 +1129,7 @@ static void test_HTMLDocument(void) | ok(tmp_hwnd == hwnd, "tmp_hwnd=%p, expected %p\n", tmp_hwnd, hwnd); | } | | - if(cmdtrg) | + if(cmdtrg && expect_SetActiveObject_active) | test_OleCommandTarget(cmdtrg); | | if(view) {
OLECMDID_OPEN seems to be supported at least on winME. I am curious, why?
I mean OLECMDID_OPEN is *not supported* on winME. As isn't OLECMDID_NEW. Sorry for typo-inversions.
Saulius Krasuckas wrote:
- On Sun, 14 Aug 2005, Jacek Caban wrote:
I'm not sure if it is a correct fix. Although it avoids crashes, much less functionality of QueryStatus is tested. Before your patch all possible commands were tested.
This is true only for nt family windows. :-P On 9x test function exits on an exception.
As I wrote before, it'll be probably true for 9x family after UIActivate succeeded.
it seems to be a case similar to crashes on xp while HTMLDocument is not active in place. In this case it is not active in place because UIActivate fails. Looking at the test results, UIActivate is a problem on every win 9x and causes most tests to fail. So first UIActivate should be fixed and then, if this problem remains, we'll be sure that your fix is correct.
I don't understand much in all this OLE/In-Place stuph, so I agree, but still I doubt this would be a sufficient to proof my patch is correct. :-]
Presently if you want to make this test not to crash, you may disable IOleCommand tests if UIActivate fails.
I will try, but what should be done with this (inside test_HTMLDocument)?
| OLECMD cmd[2] = { | {OLECMDID_OPEN, 0xf0f0}, | {OLECMDID_GETPRINTTEMPLATE+1, 0xf0f0} | }; | | hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmd, NULL); | ok(hres == OLECMDERR_E_NOTSUPPORTED, | "QueryStatus failed: %08lx, expected OLECMDERR_E_NOTSUPPORTED\n", hres);
It should be disabled as well.
Or IOW, why first call generates exception on OLECMDID_OPEN command while second do not?
| hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmd, NULL); | hres = IOleCommandTarget_QueryStatus(cmdtrg, &IID_IHTMLDocument2, 2, cmd, NULL);
OLECMDID_OPEN seems to be supported at least on winME. I am curious, why?
The second call returns after checking that IID_IHTMLDocument2 is not a valid command group id and it doesn't have to check anything else like the current state of HTMLDocument.
My guess is that it requires to be loaded before a call to UIActivate,
What do you exactly mean by "it"?
HTMLDocument
so the attached patch might help (even if so, a few other tests will fail, but currently the most interesting is UIActivate),
No, the patch didn't help.
OK, I'll take a look at this today or tomorrow.
Is something like this OK? I have "borrowed" boolean variable expect_SetActiveObject_active.
Yes, it looks good.
Thanks, Jacek
* On Sun, 14 Aug 2005, Jacek Caban wrote:
- Saulius Krasuckas wrote:
Is something like this OK? I have "borrowed" boolean variable expect_SetActiveObject_active.
Yes, it looks good.
Does that mean by a chance it can to wine-patches? :-)
Saulius Krasuckas wrote:
- On Sun, 14 Aug 2005, Jacek Caban wrote:
- Saulius Krasuckas wrote:
Is something like this OK? I have "borrowed" boolean variable expect_SetActiveObject_active.
Yes, it looks good.
Does that mean by a chance it can to wine-patches? :-)
Hello.
Yes, it could, but I've tried to get other tests working on win 98, without success. It's possible that it won't work this way on 9x, so the best solution is to disable all tests after UIActivate fails. I'll do so today and send together with cleanup.
Thanks, Jacek
* On Mon, 15 Aug 2005, Jacek Caban wrote:
I've tried to get other tests working on win 98, without success. It's possible that it won't work this way on 9x,
It seems I've found one bug in test/htmldoc.c:
| if(activeobj) { | - IOleInPlaceActiveObject_GetWindow(activeobj, &hwnd); | + hres = IOleInPlaceActiveObject_GetWindow(activeobj, &hwnd); | ok(hres == S_OK, "GetWindow failed: %08lx\n", hres);
And we have a failure in an old version of test on winME:
| htmldoc.c:502: Test failed: GetWindow failed: 80004005
* [1] writes: | | IOleInPlaceActiveObject::GetWindow | | Always fails and returns E_FAIL for a windowless | control. Since this is documented in the current | OLE2 specification, there should not be any problem | with existing containers and frames.
So something might be missing here, I thought.
OTOH, winME always returns E_FAIL {80004005} in this test [2], while win98 seems to return HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) {800700b7} [3].
Maybe you give it a test-try on win98 as there is no way to do it by WT now. :-(
[1] http://www.daimi.au.dk/~datpete/COT/OC96_SPEC/oc96.html#_Toc349649615 [2] http://test.winehq.org/data/200508151000/me_s2/mshtml:htmldoc.txt [3] http://test.winehq.org/data/200508151000/98_PV-W98SE-Full/mshtml:htmldoc.txt
Saulius Krasuckas wrote:
- On Mon, 15 Aug 2005, Jacek Caban wrote:
I've tried to get other tests working on win 98, without success. It's possible that it won't work this way on 9x,
It seems I've found one bug in test/htmldoc.c:
| if(activeobj) { | - IOleInPlaceActiveObject_GetWindow(activeobj, &hwnd); | + hres = IOleInPlaceActiveObject_GetWindow(activeobj, &hwnd); | ok(hres == S_OK, "GetWindow failed: %08lx\n", hres);
Right, it's a bug.
And we have a failure in an old version of test on winME:
| htmldoc.c:502: Test failed: GetWindow failed: 80004005
- [1] writes:
| | IOleInPlaceActiveObject::GetWindow | | Always fails and returns E_FAIL for a windowless | control. Since this is documented in the current | OLE2 specification, there should not be any problem | with existing containers and frames.
So something might be missing here, I thought.
OTOH, winME always returns E_FAIL {80004005} in this test [2], while win98 seems to return HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) {800700b7} [3].
And I'd expect E_FAIL here as GetWindow fails if HTMLDocument is not active in-place (and it's not here because UIActivate failed). Other tests show that it's correct.
Maybe you give it a test-try on win98 as there is no way to do it by WT now. :-(
We shouldn't care too much about it as it happens only in scenario when UIActivate fails that won't happen in Wine (and in nt). I've tested different ways UIActivate can fail on xp and Wine fails the same way.
Jacek