- Fix use-after-return in ReleaseAndWaitForDestructor if it times out
while running unit tests. - Increase PluginTest PDF load timeout.
This commit is contained in:
parent
70ed95bcca
commit
16f8a66040
|
@ -51,7 +51,11 @@ const char kPdfHtmlUrl[] = "http://tests/pdf.html";
|
|||
const char kPdfDirectUrl[] = "http://tests/pdf.pdf";
|
||||
|
||||
// Delay waiting for iframe tests to load the PDF file.
|
||||
#if defined(OS_LINUX)
|
||||
const int64 kPdfLoadDelayMs = 7000;
|
||||
#else
|
||||
const int64 kPdfLoadDelayMs = 5000;
|
||||
#endif
|
||||
|
||||
// Browser-side test handler.
|
||||
class PluginTestHandler : public RoutingTestHandler,
|
||||
|
|
|
@ -299,10 +299,15 @@ template<typename T>
|
|||
void ReleaseAndWaitForDestructor(CefRefPtr<T>& handler, int delay_ms = 2000) {
|
||||
base::WaitableEvent event(true, false);
|
||||
handler->SetDestroyEvent(&event);
|
||||
T* _handler_ptr = handler.get();
|
||||
handler = NULL;
|
||||
bool handler_destructed =
|
||||
event.TimedWait(base::TimeDelta::FromMilliseconds(delay_ms));
|
||||
EXPECT_TRUE(handler_destructed);
|
||||
if (!handler_destructed) {
|
||||
// |event| is a stack variable so clear the reference before returning.
|
||||
_handler_ptr->SetDestroyEvent(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
// Post a task to the specified thread and wait for the task to execute as
|
||||
|
|
Loading…
Reference in New Issue