mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add new FrameTest.* unit tests and fix discovered CefFrame-related bugs.
- Allow empty |name| argument to CefBrowser::GetFrame. This will return the main frame. - Modify CefBrowser::GetFrame to search both assigned and unique frame names. - Calling CefFrame::IsFocused on the main frame should return true when there are no other frames. - Fix CefBrowser::GetFrameIdentifiers and GetFrameNames to return correct values in the renderer process (issue #1236). - Delete NavigationTest.FrameNameIdent which is now obsoleted by the new FrameTests. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1842 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -251,4 +251,35 @@ bool TestFailed();
|
||||
#define EXPECT_FILE_THREAD() EXPECT_TRUE(CefCurrentlyOn(TID_FILE));
|
||||
#define EXPECT_RENDERER_THREAD() EXPECT_TRUE(CefCurrentlyOn(TID_RENDERER));
|
||||
|
||||
// Helper macros for executing checks in a method with a boolean return value.
|
||||
// For example:
|
||||
//
|
||||
// bool VerifyVals(bool a, bool b) {
|
||||
// V_DECLARE();
|
||||
// V_EXPECT_TRUE(a);
|
||||
// V_EXPECT_FALSE(b);
|
||||
// V_RETURN();
|
||||
// }
|
||||
//
|
||||
// EXPECT_TRUE(VerifyVals(true, false));
|
||||
|
||||
#define V_DECLARE() \
|
||||
bool __verify = true; \
|
||||
bool __result
|
||||
|
||||
#define V_RETURN() \
|
||||
return __verify
|
||||
|
||||
#define V_EXPECT_TRUE(condition) \
|
||||
__result = !!(condition); \
|
||||
__verify &= __result; \
|
||||
GTEST_TEST_BOOLEAN_(__result, #condition, false, true, \
|
||||
GTEST_NONFATAL_FAILURE_)
|
||||
|
||||
#define V_EXPECT_FALSE(condition) \
|
||||
__result = !!(condition); \
|
||||
__verify &= !__result; \
|
||||
GTEST_TEST_BOOLEAN_(!(__result), #condition, true, false, \
|
||||
GTEST_NONFATAL_FAILURE_)
|
||||
|
||||
#endif // CEF_TESTS_UNITTESTS_TEST_HANDLER_H_
|
||||
|
Reference in New Issue
Block a user