Fix tests that were broken by OnLoadEnd() no longer being called for failed provisional loading (issue #381).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@343 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
5155483796
commit
acf7cf5738
|
@ -267,18 +267,12 @@ public:
|
|||
// Verify that the request is the same
|
||||
VerifyRequestEqual(request_, request, true);
|
||||
|
||||
DestroyTest();
|
||||
|
||||
// No results
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int httpStatusCode) OVERRIDE
|
||||
{
|
||||
if(!browser->IsPopup() && frame->IsMain())
|
||||
DestroyTest();
|
||||
}
|
||||
|
||||
CefRefPtr<CefRequest> request_;
|
||||
};
|
||||
|
||||
|
|
|
@ -67,12 +67,18 @@ public:
|
|||
got_sub_success;
|
||||
};
|
||||
|
||||
// Current scheme handler object. Used when destroying the test from
|
||||
// ClientSchemeHandler::ProcessRequest().
|
||||
class TestSchemeHandler;
|
||||
TestSchemeHandler* g_current_handler = NULL;
|
||||
|
||||
class TestSchemeHandler : public TestHandler
|
||||
{
|
||||
public:
|
||||
TestSchemeHandler(TestResults* tr)
|
||||
: test_results_(tr)
|
||||
{
|
||||
g_current_handler = this;
|
||||
}
|
||||
|
||||
virtual void RunTest() OVERRIDE
|
||||
|
@ -80,6 +86,13 @@ public:
|
|||
CreateBrowser(test_results_->url);
|
||||
}
|
||||
|
||||
// Necessary to make the method public in order to destroy the test from
|
||||
// ClientSchemeHandler::ProcessRequest().
|
||||
void DestroyTest()
|
||||
{
|
||||
TestHandler::DestroyTest();
|
||||
}
|
||||
|
||||
virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
|
@ -198,6 +211,10 @@ public:
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Response was canceled.
|
||||
if (g_current_handler)
|
||||
g_current_handler->DestroyTest();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue