mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Improvements to unit test behavior.
- Standardize the test timeout implementation using a new TestHandler::SetTestTimeout method and enable timeouts for almost all tests. The test timeout can be disabled globally using a new `--disable-test-timeout` command-line flag. - Wait for TestHandler object destruction at the end of each test using a new ReleaseAndWaitForDestructor function. This avoids test state leakage and verifies that no object references are leaked. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1964 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -270,6 +270,9 @@ class TestDOMHandler : public TestHandler {
|
||||
|
||||
AddResource(kTestUrl, mainHtml.str(), "text/html");
|
||||
CreateBrowser(kTestUrl);
|
||||
|
||||
// Time out the test after a reasonable period of time.
|
||||
SetTestTimeout();
|
||||
}
|
||||
|
||||
void OnLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||
@@ -316,6 +319,8 @@ TEST(DOMTest, Read) {
|
||||
|
||||
EXPECT_TRUE(handler->got_message_);
|
||||
EXPECT_TRUE(handler->got_success_);
|
||||
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
||||
// Test DOM modifications.
|
||||
@@ -326,6 +331,8 @@ TEST(DOMTest, Modify) {
|
||||
|
||||
EXPECT_TRUE(handler->got_message_);
|
||||
EXPECT_TRUE(handler->got_success_);
|
||||
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
||||
// Entry point for creating DOM renderer test objects.
|
||||
|
Reference in New Issue
Block a user