Title: [152767] trunk/Source/WebKit2
Revision
152767
Author
[email protected]
Date
2013-07-17 00:19:15 -0700 (Wed, 17 Jul 2013)

Log Message

[EFL][WK2] EWK2FileChooserRequestTest should be defined by inheriting from EWK2UnitTestBase.
https://bugs.webkit.org/show_bug.cgi?id=118773

Patch by Dong-Gwan Kim <[email protected]> on 2013-07-17
Reviewed by Christophe Dumez.

It should be defined as relevant test class specific to each test file for more readability.
It could be helpful to remove unnecessary static methods.

* UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp:
(EWK2FileChooserRequestTest::onFileChooserRequest):
(EWK2FileChooserRequestTest::compareStrings):
(EWK2FileChooserRequestTest::freeStringList):
(TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (152766 => 152767)


--- trunk/Source/WebKit2/ChangeLog	2013-07-17 07:18:31 UTC (rev 152766)
+++ trunk/Source/WebKit2/ChangeLog	2013-07-17 07:19:15 UTC (rev 152767)
@@ -1,5 +1,21 @@
 2013-07-17  Dong-Gwan Kim  <[email protected]>
 
+        [EFL][WK2] EWK2FileChooserRequestTest should be defined by inheriting from EWK2UnitTestBase.
+        https://bugs.webkit.org/show_bug.cgi?id=118773
+
+        Reviewed by Christophe Dumez.
+
+        It should be defined as relevant test class specific to each test file for more readability.
+        It could be helpful to remove unnecessary static methods.
+
+        * UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp:
+        (EWK2FileChooserRequestTest::onFileChooserRequest):
+        (EWK2FileChooserRequestTest::compareStrings):
+        (EWK2FileChooserRequestTest::freeStringList):
+        (TEST_F):
+
+2013-07-17  Dong-Gwan Kim  <[email protected]>
+
         [EFL][WK2] EWK2FaviconDatabaseTest should be defined by inheriting from EWK2UnitTestBase.
         https://bugs.webkit.org/show_bug.cgi?id=118772
 

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp (152766 => 152767)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp	2013-07-17 07:18:31 UTC (rev 152766)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp	2013-07-17 07:19:15 UTC (rev 152767)
@@ -32,34 +32,38 @@
 
 extern EWK2UnitTestEnvironment* environment;
 
-static void onFileChooserRequest(void* userData, Evas_Object*, void* eventInfo)
-{
-    Ewk_File_Chooser_Request** returnRequest = static_cast<Ewk_File_Chooser_Request**>(userData);
-    ASSERT_TRUE(returnRequest);
-    Ewk_File_Chooser_Request* request = static_cast<Ewk_File_Chooser_Request*>(eventInfo);
-    ASSERT_TRUE(request);
+class EWK2FileChooserRequestTest : public EWK2UnitTestBase {
+public:
+    static void onFileChooserRequest(void* userData, Evas_Object*, void* eventInfo)
+    {
+        Ewk_File_Chooser_Request** returnRequest = static_cast<Ewk_File_Chooser_Request**>(userData);
+        ASSERT_TRUE(returnRequest);
+        Ewk_File_Chooser_Request* request = static_cast<Ewk_File_Chooser_Request*>(eventInfo);
+        ASSERT_TRUE(request);
 
-    // Ref the request to process asynchronously.
-    *returnRequest = ewk_object_ref(request);
-}
+        // Ref the request to process asynchronously.
+        *returnRequest = ewk_object_ref(request);
+    }
 
-static int compareStrings(const void* string1, const void* string2)
-{
-    ASSERT(string1);
-    ASSERT(string2);
+    static int compareStrings(const void* string1, const void* string2)
+    {
+        ASSERT(string1);
+        ASSERT(string2);
 
-    return strcmp(static_cast<const char*>(string1), static_cast<const char*>(string2));
-}
+        return strcmp(static_cast<const char*>(string1), static_cast<const char*>(string2));
+    }
 
-static void freeStringList(Eina_List** list)
-{
-    void* data;
-    EINA_LIST_FREE(*list, data) {
+protected:
+    void freeStringList(Eina_List** list)
+    {
+        void* data;
+        EINA_LIST_FREE(*list, data) {
         eina_stringshare_del(static_cast<char*>(data));
+        }
     }
-}
+};
 
-TEST_F(EWK2UnitTestBase, ewk_file_chooser_request_files_choose)
+TEST_F(EWK2FileChooserRequestTest, ewk_file_chooser_request_files_choose)
 {
     Ewk_File_Chooser_Request* request = 0;
     evas_object_smart_callback_add(webView(), "file,chooser,request", onFileChooserRequest, &request);
@@ -98,7 +102,7 @@
     EXPECT_TRUE(waitUntilTitleChangedTo("file1.png|file2.png"));
 }
 
-TEST_F(EWK2UnitTestBase, ewk_file_chooser_request_file_choose)
+TEST_F(EWK2FileChooserRequestTest, ewk_file_chooser_request_file_choose)
 {
     Ewk_File_Chooser_Request* request = 0;
     evas_object_smart_callback_add(webView(), "file,chooser,request", onFileChooserRequest, &request);
@@ -124,7 +128,7 @@
     EXPECT_TRUE(waitUntilTitleChangedTo("file3.png"));
 }
 
-TEST_F(EWK2UnitTestBase, ewk_file_chooser_request_file_cancel)
+TEST_F(EWK2FileChooserRequestTest, ewk_file_chooser_request_file_cancel)
 {
     Ewk_File_Chooser_Request* request = 0;
     evas_object_smart_callback_add(webView(), "file,chooser,request", onFileChooserRequest, &request);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to