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

Log Message

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

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_window_features.cpp:
(EWK2WindowFeaturesTest::createDefaultWindow):
(EWK2WindowFeaturesTest::createWindow):
(TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (152772 => 152773)


--- trunk/Source/WebKit2/ChangeLog	2013-07-17 07:26:27 UTC (rev 152772)
+++ trunk/Source/WebKit2/ChangeLog	2013-07-17 07:27:41 UTC (rev 152773)
@@ -1,5 +1,20 @@
 2013-07-17  Dong-Gwan Kim  <[email protected]>
 
+        [EFL][WK2] EWK2WindowFeaturesTest should be defined by inheriting from EWK2UnitTestBase.
+        https://bugs.webkit.org/show_bug.cgi?id=118780
+
+        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_window_features.cpp:
+        (EWK2WindowFeaturesTest::createDefaultWindow):
+        (EWK2WindowFeaturesTest::createWindow):
+        (TEST_F):
+
+2013-07-17  Dong-Gwan Kim  <[email protected]>
+
         [EFL][WK2] EWK2ViewTest should be defined by inheriting from EWK2UnitTestBase.
         https://bugs.webkit.org/show_bug.cgi?id=118779
 

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_window_features.cpp (152772 => 152773)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_window_features.cpp	2013-07-17 07:26:27 UTC (rev 152772)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_window_features.cpp	2013-07-17 07:27:41 UTC (rev 152773)
@@ -33,38 +33,62 @@
 using namespace EWK2UnitTest;
 using namespace WebCore;
 
-static Evas_Object* createDefaultWindow(Ewk_View_Smart_Data* smartData, const char*, const Ewk_Window_Features* windowFeatures)
-{
-    // default values of WebCore:WindowFeatures()
-    // - menuBarVisible(true)
-    // - statusBarVisible(true)
-    // - toolBarVisible(true)
-    // - locationBarVisible(true)
-    // - scrollbarsVisible(true)
-    // - resizable(true)
-    // - fullscreen(false)
+class EWK2WindowFeaturesTest : public EWK2UnitTestBase {
+public:
+    static Evas_Object* createDefaultWindow(Ewk_View_Smart_Data* smartData, const char*, const Ewk_Window_Features* windowFeatures)
+    {
+        // default values of WebCore:WindowFeatures()
+        // - menuBarVisible(true)
+        // - statusBarVisible(true)
+        // - toolBarVisible(true)
+        // - locationBarVisible(true)
+        // - scrollbarsVisible(true)
+        // - resizable(true)
+        // - fullscreen(false)
 
-    EXPECT_TRUE(ewk_window_features_toolbar_visible_get(windowFeatures));
-    EXPECT_TRUE(ewk_window_features_statusbar_visible_get(windowFeatures));
-    EXPECT_TRUE(ewk_window_features_scrollbars_visible_get(windowFeatures));
-    EXPECT_TRUE(ewk_window_features_menubar_visible_get(windowFeatures));
-    EXPECT_TRUE(ewk_window_features_locationbar_visible_get(windowFeatures));
-    EXPECT_TRUE(ewk_window_features_resizable_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_toolbar_visible_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_statusbar_visible_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_scrollbars_visible_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_menubar_visible_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_locationbar_visible_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_resizable_get(windowFeatures));
 
-    EXPECT_FALSE(ewk_window_features_fullscreen_get(windowFeatures));
+        EXPECT_FALSE(ewk_window_features_fullscreen_get(windowFeatures));
 
-    int x, y, width, height;
-    ewk_window_features_geometry_get(windowFeatures, &x, &y, &width, &height);
+        int x, y, width, height;
+        ewk_window_features_geometry_get(windowFeatures, &x, &y, &width, &height);
 
-    EXPECT_EQ(0, x);
-    EXPECT_EQ(0, y);
-    EXPECT_EQ(0, width);
-    EXPECT_EQ(0, height);
+        EXPECT_EQ(0, x);
+        EXPECT_EQ(0, y);
+        EXPECT_EQ(0, width);
+        EXPECT_EQ(0, height);
 
-    return 0;
-}
+        return 0;
+    }
 
-TEST_F(EWK2UnitTestBase, ewk_window_features_default_property_get)
+    static Evas_Object* createWindow(Ewk_View_Smart_Data *smartData, const char*, const Ewk_Window_Features *windowFeatures)
+    {
+        EXPECT_FALSE(ewk_window_features_toolbar_visible_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_statusbar_visible_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_scrollbars_visible_get(windowFeatures));
+        EXPECT_FALSE(ewk_window_features_menubar_visible_get(windowFeatures));
+        EXPECT_FALSE(ewk_window_features_locationbar_visible_get(windowFeatures));
+        EXPECT_TRUE(ewk_window_features_resizable_get(windowFeatures));
+        EXPECT_FALSE(ewk_window_features_fullscreen_get(windowFeatures));
+
+        int x, y, width, height;
+        ewk_window_features_geometry_get(windowFeatures, &x, &y, &width, &height);
+
+        EXPECT_EQ(100, x);
+        EXPECT_EQ(150, y);
+        EXPECT_EQ(400, width);
+        EXPECT_EQ(400, height);
+
+        return 0;
+    }
+};
+
+TEST_F(EWK2WindowFeaturesTest, ewk_window_features_default_property_get)
 {
     Evas_Object* view = webView();
 
@@ -76,29 +100,8 @@
     ASSERT_TRUE(waitUntilLoadFinished());
 }
 
-static Evas_Object* createWindow(Ewk_View_Smart_Data *smartData, const char*, const Ewk_Window_Features *windowFeatures)
+TEST_F(EWK2WindowFeaturesTest, ewk_window_features_property_get)
 {
-    EXPECT_FALSE(ewk_window_features_toolbar_visible_get(windowFeatures));
-    EXPECT_TRUE(ewk_window_features_statusbar_visible_get(windowFeatures));
-    EXPECT_TRUE(ewk_window_features_scrollbars_visible_get(windowFeatures));
-    EXPECT_FALSE(ewk_window_features_menubar_visible_get(windowFeatures));
-    EXPECT_FALSE(ewk_window_features_locationbar_visible_get(windowFeatures));
-    EXPECT_TRUE(ewk_window_features_resizable_get(windowFeatures));
-    EXPECT_FALSE(ewk_window_features_fullscreen_get(windowFeatures));
-
-    int x, y, width, height;
-    ewk_window_features_geometry_get(windowFeatures, &x, &y, &width, &height);
-
-    EXPECT_EQ(100, x);
-    EXPECT_EQ(150, y);
-    EXPECT_EQ(400, width);
-    EXPECT_EQ(400, height);
-
-    return 0;
-}
-
-TEST_F(EWK2UnitTestBase, ewk_window_features_property_get)
-{
     Evas_Object* view = webView();
 
     const char windowHTML[] = "<html><body _onLoad_=\"window.open('', '', 'left=100,top=150,width=400,height=400,location=no,menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,fullscreen=no');\"></body></html>";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to