Title: [122102] trunk/Source/WebKit/efl
Revision
122102
Author
[email protected]
Date
2012-07-09 04:36:37 -0700 (Mon, 09 Jul 2012)

Log Message

[EFL] Simplify runTest function by defining default arguments.
https://bugs.webkit.org/show_bug.cgi?id=90525

Patch by Krzysztof Czech <[email protected]> on 2012-07-09
Reviewed by Chang Shu.

Default arguments will simplify macro RUN_TEST.
Function will only have one mandatory argument, callback test function.
Added static modifiers to callback functions.

* tests/UnitTestUtils/EWKTestBase.h:
(EWKTestBase):
* tests/test_ewk_view.cpp:
(ewkViewEditableGetCb):
(TEST):
(ewkViewUriGetCb):

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (122101 => 122102)


--- trunk/Source/WebKit/efl/ChangeLog	2012-07-09 10:52:12 UTC (rev 122101)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-07-09 11:36:37 UTC (rev 122102)
@@ -1,3 +1,21 @@
+2012-07-09  Krzysztof Czech  <[email protected]>
+
+        [EFL] Simplify runTest function by defining default arguments.
+        https://bugs.webkit.org/show_bug.cgi?id=90525
+
+        Reviewed by Chang Shu.
+
+        Default arguments will simplify macro RUN_TEST.
+        Function will only have one mandatory argument, callback test function.
+        Added static modifiers to callback functions.
+
+        * tests/UnitTestUtils/EWKTestBase.h:
+        (EWKTestBase):
+        * tests/test_ewk_view.cpp:
+        (ewkViewEditableGetCb):
+        (TEST):
+        (ewkViewUriGetCb):
+
 2012-07-08  Christophe Dumez  <[email protected]>
 
         [EFL] REGRESSION (r122035): fullscreen/exit-full-screen-iframe.html is crashing

Modified: trunk/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h (122101 => 122102)


--- trunk/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h	2012-07-09 10:52:12 UTC (rev 122101)
+++ trunk/Source/WebKit/efl/tests/UnitTestUtils/EWKTestBase.h	2012-07-09 11:36:37 UTC (rev 122102)
@@ -59,8 +59,8 @@
     static void startTest();
     static void endTest();
 
-    static bool runTest(const char* url, void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data);
-    static bool runTest(void (*event_callback)(void*, Evas_Object*, void*), const char* event_name, void* event_data);
+    static bool runTest(const char* url, void (*event_callback)(void*, Evas_Object*, void*), const char* event_name = "load,finished", void* event_data = 0);
+    static bool runTest(void (*event_callback)(void*, Evas_Object*, void*), const char* event_name = "load,finished", void* event_data = 0);
 
     static int useX11Window;
 };

Modified: trunk/Source/WebKit/efl/tests/test_ewk_view.cpp (122101 => 122102)


--- trunk/Source/WebKit/efl/tests/test_ewk_view.cpp	2012-07-09 10:52:12 UTC (rev 122101)
+++ trunk/Source/WebKit/efl/tests/test_ewk_view.cpp	2012-07-09 11:36:37 UTC (rev 122102)
@@ -27,7 +27,7 @@
 /**
 * @brief Checking whether function properly returns correct value.
 */
-void ewkViewEditableGetCb(void* eventInfo, Evas_Object* o, void* data)
+static void ewkViewEditableGetCb(void* eventInfo, Evas_Object* o, void* data)
 {
     ewk_view_editable_set(o, EINA_FALSE);
     EXPECT_EQ(EINA_FALSE, ewk_view_editable_get(o));
@@ -36,13 +36,13 @@
 
 TEST(test_ewk_view, ewk_view_editable_get)
 {
-    RUN_TEST(ewkViewEditableGetCb, "load,finished", 0);
+    RUN_TEST(ewkViewEditableGetCb);
 }
 
 /**
 * @brief Checking whether function returns correct uri string.
 */
-void ewkViewUriGetCb(void* eventInfo, Evas_Object* o, void* data)
+static void ewkViewUriGetCb(void* eventInfo, Evas_Object* o, void* data)
 {
     EXPECT_STREQ("http://www.webkit.org/", ewk_view_uri_get(o));
     END_TEST();
@@ -50,5 +50,5 @@
 
 TEST(test_ewk_view, ewk_view_uri_get)
 {
-    RUN_TEST("http://www.webkit.org", ewkViewUriGetCb, "load,finished", 0);
+    RUN_TEST("http://www.webkit.org", ewkViewUriGetCb);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to