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

Log Message

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

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_context.cpp:
(EWK2ContextTest::schemeRequestCallback):
(TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (152759 => 152760)


--- trunk/Source/WebKit2/ChangeLog	2013-07-17 07:05:40 UTC (rev 152759)
+++ trunk/Source/WebKit2/ChangeLog	2013-07-17 07:06:18 UTC (rev 152760)
@@ -1,5 +1,19 @@
 2013-07-17  Dong-Gwan Kim  <[email protected]>
 
+        [EFL][WK2] EWK2ContextTest should be defined by inheriting from EWK2UnitTestBase.
+        https://bugs.webkit.org/show_bug.cgi?id=118763
+
+        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_context.cpp:
+        (EWK2ContextTest::schemeRequestCallback):
+        (TEST_F):
+
+2013-07-17  Dong-Gwan Kim  <[email protected]>
+
         [EFL][WK2] EWK2DatabaseManagerTest should be defined by inheriting from EWK2UnitTestBase
         https://bugs.webkit.org/show_bug.cgi?id=118726
 

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp (152759 => 152760)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp	2013-07-17 07:05:40 UTC (rev 152759)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp	2013-07-17 07:06:18 UTC (rev 152760)
@@ -34,14 +34,28 @@
 
 static const char htmlReply[] = "<html><head><title>Foo</title></head><body>Bar</body></html>";
 
-TEST_F(EWK2UnitTestBase, ewk_context_default_get)
+class EWK2ContextTest : public EWK2UnitTestBase {
+public:
+    static void schemeRequestCallback(Ewk_Url_Scheme_Request* request, void* userData)
+    {
+        const char* scheme = ewk_url_scheme_request_scheme_get(request);
+        ASSERT_STREQ("fooscheme", scheme);
+        const char* url = ""
+        ASSERT_STREQ("fooscheme:MyPath", url);
+        const char* path = ewk_url_scheme_request_path_get(request);
+        ASSERT_STREQ("MyPath", path);
+        ASSERT_TRUE(ewk_url_scheme_request_finish(request, htmlReply, strlen(htmlReply), "text/html"));
+    }
+};
+
+TEST_F(EWK2ContextTest, ewk_context_default_get)
 {
     Ewk_Context* defaultContext = ewk_context_default_get();
     ASSERT_TRUE(defaultContext);
     ASSERT_EQ(defaultContext, ewk_context_default_get());
 }
 
-TEST_F(EWK2UnitTestBase, ewk_context_cookie_manager_get)
+TEST_F(EWK2ContextTest, ewk_context_cookie_manager_get)
 {
     Ewk_Context* context = ewk_view_context_get(webView());
     Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(context);
@@ -49,7 +63,7 @@
     ASSERT_EQ(cookieManager, ewk_context_cookie_manager_get(context));
 }
 
-TEST_F(EWK2UnitTestBase, ewk_context_database_manager_get)
+TEST_F(EWK2ContextTest, ewk_context_database_manager_get)
 {
     Ewk_Context* context = ewk_view_context_get(webView());
     Ewk_Database_Manager* databaseManager = ewk_context_database_manager_get(context);
@@ -57,7 +71,7 @@
     ASSERT_EQ(databaseManager, ewk_context_database_manager_get(context));
 }
 
-TEST_F(EWK2UnitTestBase, ewk_context_favicon_database_get)
+TEST_F(EWK2ContextTest, ewk_context_favicon_database_get)
 {
     Ewk_Context* context = ewk_view_context_get(webView());
     Ewk_Favicon_Database* faviconDatabase = ewk_context_favicon_database_get(context);
@@ -65,7 +79,7 @@
     ASSERT_EQ(faviconDatabase, ewk_context_favicon_database_get(context));
 }
 
-TEST_F(EWK2UnitTestBase, ewk_context_storage_manager_get)
+TEST_F(EWK2ContextTest, ewk_context_storage_manager_get)
 {
     Ewk_Context* context = ewk_view_context_get(webView());
     Ewk_Storage_Manager* storageManager = ewk_context_storage_manager_get(context);
@@ -73,25 +87,14 @@
     ASSERT_EQ(storageManager, ewk_context_storage_manager_get(context));
 }
 
-static void schemeRequestCallback(Ewk_Url_Scheme_Request* request, void* userData)
+TEST_F(EWK2ContextTest, ewk_context_url_scheme_register)
 {
-    const char* scheme = ewk_url_scheme_request_scheme_get(request);
-    ASSERT_STREQ("fooscheme", scheme);
-    const char* url = ""
-    ASSERT_STREQ("fooscheme:MyPath", url);
-    const char* path = ewk_url_scheme_request_path_get(request);
-    ASSERT_STREQ("MyPath", path);
-    ASSERT_TRUE(ewk_url_scheme_request_finish(request, htmlReply, strlen(htmlReply), "text/html"));
-}
-
-TEST_F(EWK2UnitTestBase, ewk_context_url_scheme_register)
-{
     ewk_context_url_scheme_register(ewk_view_context_get(webView()), "fooscheme", schemeRequestCallback, 0);
     ASSERT_TRUE(loadUrlSync("fooscheme:MyPath"));
     ASSERT_STREQ("Foo", ewk_view_title_get(webView()));
 }
 
-TEST_F(EWK2UnitTestBase, ewk_context_cache_model)
+TEST_F(EWK2ContextTest, ewk_context_cache_model)
 {
     Ewk_Context* context = ewk_view_context_get(webView());
 
@@ -107,21 +110,21 @@
     ASSERT_EQ(EWK_CACHE_MODEL_DOCUMENT_VIEWER, ewk_context_cache_model_get(context));
 }
 
-TEST_F(EWK2UnitTestBase, ewk_context_new)
+TEST_F(EWK2ContextTest, ewk_context_new)
 {
     Ewk_Context* context = ewk_context_new();
     ASSERT_TRUE(context);
     ewk_object_unref(context);
 }
 
-TEST_F(EWK2UnitTestBase, ewk_context_new_with_injected_bundle_path)
+TEST_F(EWK2ContextTest, ewk_context_new_with_injected_bundle_path)
 {
     Ewk_Context* context = ewk_context_new_with_injected_bundle_path(environment->injectedBundleSample());
     ASSERT_TRUE(context);
     ewk_object_unref(context);
 }
 
-TEST_F(EWK2UnitTestBase, ewk_context_additional_plugin_path_set)
+TEST_F(EWK2ContextTest, ewk_context_additional_plugin_path_set)
 {
     Ewk_Context* context = ewk_view_context_get(webView());
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to