https://bugs.webkit.org/show_bug.cgi?id=100078
Reviewed by Gyuyoung Kim.
Although applications should pass valid ewk_view to call ewk_view_XXX,
ewk_view_XXX should not be crashed.
* UIProcess/API/efl/ewk_view.cpp:
Checked null and early exited from EWK_VIEW_TYPE_CHECK if error occured.
* UIProcess/API/efl/tests/test_ewk2_view.cpp: Added test case.
(TEST_F):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132336
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-10-24 Ryuan Choi <ryuan.choi@gmail.com>
+
+ [EFL][WK2] Crash when passing NULL instead of ewk_view instance
+ https://bugs.webkit.org/show_bug.cgi?id=100078
+
+ Reviewed by Gyuyoung Kim.
+
+ Although applications should pass valid ewk_view to call ewk_view_XXX,
+ ewk_view_XXX should not be crashed.
+
+ * UIProcess/API/efl/ewk_view.cpp:
+ Checked null and early exited from EWK_VIEW_TYPE_CHECK if error occured.
+ * UIProcess/API/efl/tests/test_ewk2_view.cpp: Added test case.
+ (TEST_F):
+
2012-10-24 Christophe Dumez <christophe.dumez@intel.com>
[EFL][WK2] Make find and form clients C++ classes
#define EWK_VIEW_TYPE_CHECK(ewkView, result) \
bool result = true; \
do { \
+ if (!ewkView) { \
+ EINA_LOG_CRIT("null is not a ewk_view"); \
+ result = false; \
+ break; \
+ } \
const char* _tmp_otype = evas_object_type_get(ewkView); \
const Evas_Smart* _tmp_s = evas_object_smart_smart_get(ewkView); \
if (EINA_UNLIKELY(!_tmp_s)) { \
("%p (%s) is not a smart object!", \
ewkView, _tmp_otype ? _tmp_otype : "(null)"); \
result = false; \
+ break; \
} \
const Evas_Smart_Class* _tmp_sc = evas_smart_class_get(_tmp_s); \
if (EINA_UNLIKELY(!_tmp_sc)) { \
("%p (%s) is not a smart object!", \
ewkView, _tmp_otype ? _tmp_otype : "(null)"); \
result = false; \
+ break; \
} \
if (EINA_UNLIKELY(_tmp_sc->data != EWK_VIEW_TYPE_STR)) { \
EINA_LOG_CRIT \
extern EWK2UnitTestEnvironment* environment;
bool fullScreenCallbackCalled;
+TEST_F(EWK2UnitTestBase, ewk_view_type_check)
+{
+ ASSERT_FALSE(ewk_view_context_get(0));
+
+ Evas_Object* rectangle = evas_object_rectangle_add(canvas());
+ ASSERT_FALSE(ewk_view_url_set(rectangle, 0));
+}
+
static void onLoadFinishedForRedirection(void* userData, Evas_Object*, void*)
{
int* countLoadFinished = static_cast<int*>(userData);