зеркало из https://github.com/mozilla/gecko-dev.git
Bug 199200 Make Networking Tests XP friendly by using the eventqueueservice
r=darin
This commit is contained in:
Родитель
68cf15b0df
Коммит
ba9822bb11
|
@ -268,24 +268,9 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
// Enter the message pump to allow the URL load to proceed.
|
||||
while ( gKeepRunning ) {
|
||||
#ifdef WIN32
|
||||
MSG msg;
|
||||
|
||||
if (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
} else {
|
||||
gKeepRunning = 0;
|
||||
}
|
||||
#else
|
||||
#ifdef XP_MAC
|
||||
/* Mac stuff is missing here! */
|
||||
#else
|
||||
PLEvent *gEvent;
|
||||
rv = gEventQ->GetEvent(&gEvent);
|
||||
rv = gEventQ->HandleEvent(gEvent);
|
||||
#endif /* XP_UNIX */
|
||||
#endif /* !WIN32 */
|
||||
PLEvent *gEvent;
|
||||
gEventQ->WaitForEvent(&gEvent);
|
||||
gEventQ->HandleEvent(gEvent);
|
||||
}
|
||||
|
||||
NS_ShutdownXPCOM(nsnull);
|
||||
|
|
|
@ -344,27 +344,9 @@ main(int argc, char* argv[])
|
|||
|
||||
// Enter the message pump
|
||||
while ( gKeepRunning ) {
|
||||
#ifdef WIN32
|
||||
MSG msg;
|
||||
if (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
else
|
||||
gKeepRunning = FALSE;
|
||||
#elif XP_MAC
|
||||
/* Mac stuff is missing here! */
|
||||
#elif XP_OS2
|
||||
QMSG qmsg;
|
||||
if (WinGetMsg(0, &qmsg, 0, 0, 0))
|
||||
WinDispatchMsg(0, &qmsg);
|
||||
else
|
||||
gKeepRunning = FALSE;
|
||||
#else
|
||||
PLEvent *gEvent;
|
||||
rv = gEventQ->WaitForEvent(&gEvent);
|
||||
rv = gEventQ->HandleEvent(gEvent);
|
||||
#endif
|
||||
gEventQ->WaitForEvent(&gEvent);
|
||||
gEventQ->HandleEvent(gEvent);
|
||||
}
|
||||
|
||||
PRTime endTime;
|
||||
|
|
|
@ -645,24 +645,9 @@ main(int argc, char* argv[])
|
|||
}
|
||||
// Enter the message pump to allow the URL load to proceed.
|
||||
while ( gKeepRunning ) {
|
||||
#ifdef WIN32
|
||||
MSG msg;
|
||||
|
||||
if (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
} else {
|
||||
gKeepRunning = 0;
|
||||
}
|
||||
#else
|
||||
#ifdef XP_MAC
|
||||
/* Mac stuff is missing here! */
|
||||
#else
|
||||
PLEvent *gEvent;
|
||||
rv = gEventQ->WaitForEvent(&gEvent);
|
||||
rv = gEventQ->HandleEvent(gEvent);
|
||||
#endif /* XP_UNIX */
|
||||
#endif /* !WIN32 */
|
||||
gEventQ->WaitForEvent(&gEvent);
|
||||
gEventQ->HandleEvent(gEvent);
|
||||
}
|
||||
} // this scopes the nsCOMPtrs
|
||||
// no nsCOMPtrs are allowed to be alive when you call NS_ShutdownXPCOM
|
||||
|
|
|
@ -343,27 +343,9 @@ main(int argc, char* argv[])
|
|||
|
||||
// Enter the message pump to allow the URL load to proceed.
|
||||
while ( gKeepRunning ) {
|
||||
#ifdef WIN32
|
||||
MSG msg;
|
||||
if (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
else
|
||||
gKeepRunning = FALSE;
|
||||
#elif XP_MAC
|
||||
/* Mac stuff is missing here! */
|
||||
#elif XP_OS2
|
||||
QMSG qmsg;
|
||||
if (WinGetMsg(0, &qmsg, 0, 0, 0))
|
||||
WinDispatchMsg(0, &qmsg);
|
||||
else
|
||||
gKeepRunning = FALSE;
|
||||
#else
|
||||
PLEvent *gEvent;
|
||||
rv = gEventQ->WaitForEvent(&gEvent);
|
||||
rv = gEventQ->HandleEvent(gEvent);
|
||||
#endif
|
||||
gEventQ->WaitForEvent(&gEvent);
|
||||
gEventQ->HandleEvent(gEvent);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -183,31 +183,9 @@ main(int argc, char* argv[])
|
|||
|
||||
// Enter the message pump to allow the URL load to proceed.
|
||||
while ( gKeepRunning ) {
|
||||
#ifdef WIN32
|
||||
MSG msg;
|
||||
|
||||
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
#else
|
||||
#ifdef XP_MAC
|
||||
/* Mac stuff is missing here! */
|
||||
#else
|
||||
#ifdef XP_OS2
|
||||
QMSG qmsg;
|
||||
|
||||
if (WinGetMsg(0, &qmsg, 0, 0, 0))
|
||||
WinDispatchMsg(0, &qmsg);
|
||||
else
|
||||
gKeepRunning = FALSE;
|
||||
#else
|
||||
PLEvent *gEvent;
|
||||
rv = eventQ->GetEvent(&gEvent);
|
||||
rv = eventQ->HandleEvent(gEvent);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
eventQ->WaitForEvent(&gEvent);
|
||||
eventQ->HandleEvent(gEvent);
|
||||
}
|
||||
|
||||
} // this scopes the nsCOMPtrs
|
||||
|
|
|
@ -190,31 +190,16 @@ main(int argc, char* argv[])
|
|||
listener = new InputTestConsumer;
|
||||
if (!listener) {
|
||||
NS_ERROR("Failed to create a new stream listener!");
|
||||
return -1;;
|
||||
return -1;
|
||||
}
|
||||
NS_ADDREF(listener);
|
||||
|
||||
channel->AsyncOpen(listener, nsnull);
|
||||
|
||||
while ( gKeepRunning ) {
|
||||
#ifdef WIN32
|
||||
MSG msg;
|
||||
|
||||
if (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
} else {
|
||||
gKeepRunning = 0;
|
||||
}
|
||||
#else
|
||||
#ifdef XP_MAC
|
||||
/* Mac stuff is missing here! */
|
||||
#else
|
||||
PLEvent *gEvent;
|
||||
rv = gEventQ->WaitForEvent(&gEvent);
|
||||
rv = gEventQ->HandleEvent(gEvent);
|
||||
#endif /* XP_UNIX */
|
||||
#endif /* !WIN32 */
|
||||
gEventQ->WaitForEvent(&gEvent);
|
||||
gEventQ->HandleEvent(gEvent);
|
||||
}
|
||||
} // this scopes the nsCOMPtrs
|
||||
// no nsCOMPtrs are allowed to be alive when you call NS_ShutdownXPCOM
|
||||
|
|
Загрузка…
Ссылка в новой задаче