From: Francois Gouget fgouget@codeweavers.com
Add code to test various tryok() scenarios and make sure it behaves as expected. --- dlls/ieframe/tests/webbrowser.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c index adb43f481f6..684bd4b358c 100644 --- a/dlls/ieframe/tests/webbrowser.c +++ b/dlls/ieframe/tests/webbrowser.c @@ -4436,6 +4436,7 @@ static void test_SetQueryNetSessionCount(void) { LONG count, init_count;
+ trace("-----\n"); /* IE may create a network session for its own purposes during the test */ LOOP_ON_FLAKY_WINDOWS_TESTS(3) { @@ -4454,6 +4455,37 @@ static void test_SetQueryNetSessionCount(void) count = pSetQueryNetSessionCount(SESSION_QUERY); tryok(count == init_count, "count = %ld\n", count); } + + trace("----- fatal loop\n"); + LOOP_ON_FLAKY_TESTS(5) + { + init_count = pSetQueryNetSessionCount(SESSION_QUERY); + trace("init_count %ld\n", init_count); + + count = pSetQueryNetSessionCount(SESSION_QUERY); + ok(count == init_count + 1, "count = %ld\n", count); + } + + trace("----- infinite todo loop\n"); + LOOP_ON_FLAKY_TESTS(2) + { + init_count = pSetQueryNetSessionCount(SESSION_QUERY); + trace("init_count %ld\n", init_count); + + count = pSetQueryNetSessionCount(SESSION_QUERY); + todo_wine tryok(count == init_count, "count = %ld\n", count); + } + + trace("----- infinite todo loop\n"); + LOOP_ON_FLAKY_TESTS(2) + { + init_count = pSetQueryNetSessionCount(SESSION_QUERY); + trace("init_count %ld\n", init_count); + + count = pSetQueryNetSessionCount(SESSION_QUERY); + todo_wine tryok(count == init_count, "count = %ld\n", count); + if (attempt_failed()) break; + } }
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) @@ -4522,6 +4554,7 @@ START_TEST(webbrowser) OleInitialize(NULL);
test_SetQueryNetSessionCount(); + if (1) return;
container_hwnd = create_container_window();