<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[152761] trunk/Source/WebKit2</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/152761">152761</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-07-17 00:09:51 -0700 (Wed, 17 Jul 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[EFL][WK2] EWK2ContextMenuTest should be defined by inheriting from EWK2UnitTestBase.
https://bugs.webkit.org/show_bug.cgi?id=118767

Patch by Dong-Gwan Kim &lt;donggwan.kim@samsung.com&gt; 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_menu.cpp:
(EWK2ContextMenuTest::checkBasicContextMenuItem):
(EWK2ContextMenuTest::customItemSelected):
(EWK2ContextMenuTest::showContextMenu):
(EWK2ContextMenuTest::showContextMenuForRemoveAndAppend):
(EWK2ContextMenuTest::showContextMenuForSubmenu):
(EWK2ContextMenuTest::hideContextMenu):
(TEST_F):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIeflteststest_ewk2_context_menucpp">trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (152760 => 152761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-07-17 07:06:18 UTC (rev 152760)
+++ trunk/Source/WebKit2/ChangeLog        2013-07-17 07:09:51 UTC (rev 152761)
</span><span class="lines">@@ -1,5 +1,24 @@
</span><span class="cx"> 2013-07-17  Dong-Gwan Kim  &lt;donggwan.kim@samsung.com&gt;
</span><span class="cx"> 
</span><ins>+        [EFL][WK2] EWK2ContextMenuTest should be defined by inheriting from EWK2UnitTestBase.
+        https://bugs.webkit.org/show_bug.cgi?id=118767
+
+        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_menu.cpp:
+        (EWK2ContextMenuTest::checkBasicContextMenuItem):
+        (EWK2ContextMenuTest::customItemSelected):
+        (EWK2ContextMenuTest::showContextMenu):
+        (EWK2ContextMenuTest::showContextMenuForRemoveAndAppend):
+        (EWK2ContextMenuTest::showContextMenuForSubmenu):
+        (EWK2ContextMenuTest::hideContextMenu):
+        (TEST_F):
+
+2013-07-17  Dong-Gwan Kim  &lt;donggwan.kim@samsung.com&gt;
+
</ins><span class="cx">         [EFL][WK2] EWK2ContextTest should be defined by inheriting from EWK2UnitTestBase.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=118763
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIeflteststest_ewk2_context_menucpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp (152760 => 152761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp        2013-07-17 07:06:18 UTC (rev 152760)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp        2013-07-17 07:09:51 UTC (rev 152761)
</span><span class="lines">@@ -41,145 +41,148 @@
</span><span class="cx"> static const char webkitItemTitle4[] = &quot;Copy Link Location&quot;;
</span><span class="cx"> static const char webkitItemNewTitle[] = &quot;Copy Link&quot;;
</span><span class="cx"> 
</span><del>-static inline void checkBasicContextMenuItem(Ewk_Context_Menu_Item* item, Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Item_Action action, const char* title, Eina_Bool checked, Eina_Bool enabled)
-{
-    ASSERT_TRUE(item);
</del><ins>+class EWK2ContextMenuTest : public EWK2UnitTestBase {
+public:
+    static void checkBasicContextMenuItem(Ewk_Context_Menu_Item* item, Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Item_Action action, const char* title, Eina_Bool checked, Eina_Bool enabled)
+    {
+        ASSERT_TRUE(item);
</ins><span class="cx"> 
</span><del>-    EXPECT_EQ(type, ewk_context_menu_item_type_get(item));
-    EXPECT_EQ(action, ewk_context_menu_item_action_get(item));
-    EXPECT_STREQ(title, ewk_context_menu_item_title_get(item));
</del><ins>+        EXPECT_EQ(type, ewk_context_menu_item_type_get(item));
+        EXPECT_EQ(action, ewk_context_menu_item_action_get(item));
+        EXPECT_STREQ(title, ewk_context_menu_item_title_get(item));
</ins><span class="cx">     EXPECT_EQ(checked, ewk_context_menu_item_checked_get(item));
</span><span class="cx">     EXPECT_EQ(enabled, ewk_context_menu_item_enabled_get(item));
</span><del>-}
</del><ins>+    }
</ins><span class="cx"> 
</span><del>-static Eina_Bool customItemSelected(Ewk_View_Smart_Data*, Ewk_Context_Menu_Item* item)
-{
-    checkBasicContextMenuItem(item, customItemType, static_cast&lt;Ewk_Context_Menu_Item_Action&gt;(customItemTag), customItemTitle, customItemChecked, customItemEnabled);
</del><ins>+    static Eina_Bool customItemSelected(Ewk_View_Smart_Data*, Ewk_Context_Menu_Item* item)
+    {
+        checkBasicContextMenuItem(item, customItemType, static_cast&lt;Ewk_Context_Menu_Item_Action&gt;(customItemTag), customItemTitle, customItemChecked, customItemEnabled);
</ins><span class="cx"> 
</span><del>-    return true;
-}
</del><ins>+        return true;
+    }
</ins><span class="cx"> 
</span><del>-/**
- * This callback receives context menu called upon link with items generated by WebKit2.
- * Items have their properties modified, and one of items is selected.
- */
-static Eina_Bool showContextMenu(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
-{
-    const Eina_List* list = ewk_context_menu_items_get(contextMenu);
-    EXPECT_EQ(4, eina_list_count(list));
</del><ins>+    /**
+     * This callback receives context menu called upon link with items generated by WebKit2.
+     * Items have their properties modified, and one of items is selected.
+     */
+    static Eina_Bool showContextMenu(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
+    {
+        const Eina_List* list = ewk_context_menu_items_get(contextMenu);
+        EXPECT_EQ(4, eina_list_count(list));
</ins><span class="cx"> 
</span><del>-    Ewk_Context_Menu_Item* item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 0));
-    checkBasicContextMenuItem(item, EWK_ACTION_TYPE, EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK, webkitItemTitle1, false, true);
</del><ins>+        Ewk_Context_Menu_Item* item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 0));
+        checkBasicContextMenuItem(item, EWK_ACTION_TYPE, EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK, webkitItemTitle1, false, true);
</ins><span class="cx"> 
</span><del>-    item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 1));
-    checkBasicContextMenuItem(item, EWK_ACTION_TYPE, EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW, webkitItemTitle2, false, true);
-    ewk_context_menu_item_enabled_set(item, false);
-    EXPECT_FALSE(ewk_context_menu_item_enabled_get(item));
</del><ins>+        item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 1));
+        checkBasicContextMenuItem(item, EWK_ACTION_TYPE, EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW, webkitItemTitle2, false, true);
+        ewk_context_menu_item_enabled_set(item, false);
+        EXPECT_FALSE(ewk_context_menu_item_enabled_get(item));
</ins><span class="cx"> 
</span><del>-    item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 2));
-    checkBasicContextMenuItem(item, EWK_ACTION_TYPE, EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_LINK_TO_DISK, webkitItemTitle3, false, true);
-    ewk_context_menu_item_checked_set(item, true);
-    EXPECT_TRUE(ewk_context_menu_item_checked_get(item));
</del><ins>+        item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 2));
+        checkBasicContextMenuItem(item, EWK_ACTION_TYPE, EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_LINK_TO_DISK, webkitItemTitle3, false, true);
+        ewk_context_menu_item_checked_set(item, true);
+        EXPECT_TRUE(ewk_context_menu_item_checked_get(item));
</ins><span class="cx"> 
</span><del>-    item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 3));
-    checkBasicContextMenuItem(item, EWK_ACTION_TYPE, EWK_CONTEXT_MENU_ITEM_TAG_COPY_LINK_TO_CLIPBOARD, webkitItemTitle4, false, true);
-    ewk_context_menu_item_title_set(item, webkitItemNewTitle);
-    EXPECT_STREQ(webkitItemNewTitle, ewk_context_menu_item_title_get(item));
</del><ins>+        item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 3));
+        checkBasicContextMenuItem(item, EWK_ACTION_TYPE, EWK_CONTEXT_MENU_ITEM_TAG_COPY_LINK_TO_CLIPBOARD, webkitItemTitle4, false, true);
+        ewk_context_menu_item_title_set(item, webkitItemNewTitle);
+        EXPECT_STREQ(webkitItemNewTitle, ewk_context_menu_item_title_get(item));
</ins><span class="cx"> 
</span><del>-    // When context menu is created by WebKit, an item should have parent menu.
-    EXPECT_EQ(contextMenu, ewk_context_menu_item_parent_menu_get(item));
</del><ins>+        // When context menu is created by WebKit, an item should have parent menu.
+        EXPECT_EQ(contextMenu, ewk_context_menu_item_parent_menu_get(item));
</ins><span class="cx"> 
</span><del>-    item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 0));
</del><ins>+        item = static_cast&lt;Ewk_Context_Menu_Item*&gt;(eina_list_nth(list, 0));
</ins><span class="cx"> 
</span><del>-    EXPECT_TRUE(ewk_context_menu_item_select(contextMenu, item));
</del><ins>+        EXPECT_TRUE(ewk_context_menu_item_select(contextMenu, item));
</ins><span class="cx"> 
</span><del>-    return true;
-}
</del><ins>+        return true;
+    }
</ins><span class="cx"> 
</span><del>-/**
- * This callback receives context menu called upon link with items generated by WebKit2.
- * Received items are removed, then custom item is created and selected.
- */
-static Eina_Bool showContextMenuForRemoveAndAppend(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
-{
-    const Eina_List* list = ewk_context_menu_items_get(contextMenu);
-    EXPECT_EQ(4, eina_list_count(list));
</del><ins>+    /**
+     * This callback receives context menu called upon link with items generated by WebKit2.
+     * Received items are removed, then custom item is created and selected.
+     */
+    static Eina_Bool showContextMenuForRemoveAndAppend(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
+    {
+        const Eina_List* list = ewk_context_menu_items_get(contextMenu);
+        EXPECT_EQ(4, eina_list_count(list));
</ins><span class="cx"> 
</span><del>-    const Eina_List* listIterator;
-    void* data;
-    EINA_LIST_FOREACH(list, listIterator, data)
-        ewk_context_menu_item_remove(contextMenu, static_cast&lt;Ewk_Context_Menu_Item*&gt;(data));
</del><ins>+        const Eina_List* listIterator;
+        void* data;
+        EINA_LIST_FOREACH(list, listIterator, data)
+            ewk_context_menu_item_remove(contextMenu, static_cast&lt;Ewk_Context_Menu_Item*&gt;(data));
</ins><span class="cx"> 
</span><del>-    list = ewk_context_menu_items_get(contextMenu);
-    EXPECT_EQ(0, eina_list_count(list));
</del><ins>+        list = ewk_context_menu_items_get(contextMenu);
+        EXPECT_EQ(0, eina_list_count(list));
</ins><span class="cx"> 
</span><del>-    Ewk_Context_Menu_Item* newItem = ewk_context_menu_item_new(customItemType, customItemTag, customItemTitle, customItemChecked, customItemEnabled);
</del><ins>+        Ewk_Context_Menu_Item* newItem = ewk_context_menu_item_new(customItemType, customItemTag, customItemTitle, customItemChecked, customItemEnabled);
</ins><span class="cx"> 
</span><del>-    // When context menu item is created using ewk_context_menu_item_new, it should not have parent menu.
-    EXPECT_EQ(0, ewk_context_menu_item_parent_menu_get(newItem));
-    ewk_context_menu_item_append(contextMenu, newItem);
</del><ins>+        // When context menu item is created using ewk_context_menu_item_new, it should not have parent menu.
+        EXPECT_EQ(0, ewk_context_menu_item_parent_menu_get(newItem));
+        ewk_context_menu_item_append(contextMenu, newItem);
</ins><span class="cx"> 
</span><del>-    // When context menu item is added to menu using ewk_context_menu_item_append, it should have parent menu.
-    EXPECT_EQ(contextMenu, ewk_context_menu_item_parent_menu_get(newItem));
</del><ins>+        // When context menu item is added to menu using ewk_context_menu_item_append, it should have parent menu.
+        EXPECT_EQ(contextMenu, ewk_context_menu_item_parent_menu_get(newItem));
</ins><span class="cx"> 
</span><del>-    // When non submenu type context menu item was created using ewk_context_menu_item_new, submenu should be 0.
-    EXPECT_EQ(0, ewk_context_menu_item_submenu_get(newItem));
</del><ins>+        // When non submenu type context menu item was created using ewk_context_menu_item_new, submenu should be 0.
+        EXPECT_EQ(0, ewk_context_menu_item_submenu_get(newItem));
</ins><span class="cx"> 
</span><del>-    EXPECT_TRUE(ewk_context_menu_item_select(contextMenu, newItem));
</del><ins>+        EXPECT_TRUE(ewk_context_menu_item_select(contextMenu, newItem));
</ins><span class="cx"> 
</span><del>-    ewk_context_menu_hide(contextMenu);
</del><ins>+        ewk_context_menu_hide(contextMenu);
</ins><span class="cx"> 
</span><del>-    return true;
-}
</del><ins>+        return true;
+    }
</ins><span class="cx"> 
</span><del>-/**
- * This callback receives context menu called upon link with items generated by WebKit2.
- * New submenus are created, one of submenu's item is selected.
- */
-static Eina_Bool showContextMenuForSubmenu(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
-{
-    Eina_List* subMenuItemList = 0;
-    Ewk_Context_Menu_Item* subMenuItem1 = ewk_context_menu_item_new(customItemType, customItemTag, customItemTitle, customItemChecked, customItemEnabled);
-    Ewk_Context_Menu_Item* subMenuItem2 = ewk_context_menu_item_new(EWK_ACTION_TYPE, static_cast&lt;Ewk_Context_Menu_Item_Action&gt;(customItemTag + 1), &quot;New SubMenu Item 2&quot;, false, true);
-    Ewk_Context_Menu_Item* subMenuItem3 = ewk_context_menu_item_new(EWK_ACTION_TYPE, static_cast&lt;Ewk_Context_Menu_Item_Action&gt;(customItemTag + 2), &quot;New SubMenu Item 3&quot;, false, true);
-    subMenuItemList = eina_list_append(subMenuItemList, subMenuItem1);
-    subMenuItemList = eina_list_append(subMenuItemList, subMenuItem2);
-    subMenuItemList = eina_list_append(subMenuItemList, subMenuItem3);
-    Ewk_Context_Menu* subMenu = ewk_context_menu_new_with_items(subMenuItemList);
</del><ins>+    /**
+     * This callback receives context menu called upon link with items generated by WebKit2.
+     * New submenus are created, one of submenu's item is selected.
+     */
+    static Eina_Bool showContextMenuForSubmenu(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
+    {
+        Eina_List* subMenuItemList = 0;
+        Ewk_Context_Menu_Item* subMenuItem1 = ewk_context_menu_item_new(customItemType, customItemTag, customItemTitle, customItemChecked, customItemEnabled);
+        Ewk_Context_Menu_Item* subMenuItem2 = ewk_context_menu_item_new(EWK_ACTION_TYPE, static_cast&lt;Ewk_Context_Menu_Item_Action&gt;(customItemTag + 1), &quot;New SubMenu Item 2&quot;, false, true);
+        Ewk_Context_Menu_Item* subMenuItem3 = ewk_context_menu_item_new(EWK_ACTION_TYPE, static_cast&lt;Ewk_Context_Menu_Item_Action&gt;(customItemTag + 2), &quot;New SubMenu Item 3&quot;, false, true);
+        subMenuItemList = eina_list_append(subMenuItemList, subMenuItem1);
+        subMenuItemList = eina_list_append(subMenuItemList, subMenuItem2);
+        subMenuItemList = eina_list_append(subMenuItemList, subMenuItem3);
+        Ewk_Context_Menu* subMenu = ewk_context_menu_new_with_items(subMenuItemList);
</ins><span class="cx"> 
</span><del>-    // When context menu is created using ewk_context_menu_new_with_items, items should have parent menu.
-    EXPECT_EQ(subMenu, ewk_context_menu_item_parent_menu_get(subMenuItem1));
</del><ins>+        // When context menu is created using ewk_context_menu_new_with_items, items should have parent menu.
+        EXPECT_EQ(subMenu, ewk_context_menu_item_parent_menu_get(subMenuItem1));
</ins><span class="cx"> 
</span><del>-    Ewk_Context_Menu_Item* newItem = ewk_context_menu_item_new_with_submenu(EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG, &quot;New Custom Item&quot;, true, subMenu);
-    // When context menu item is created using ewk_context_menu_item_new_with_submenu, it should not have parent menu.
-    EXPECT_EQ(0, ewk_context_menu_item_parent_menu_get(newItem));
-    ewk_context_menu_item_append(contextMenu, newItem);
</del><ins>+        Ewk_Context_Menu_Item* newItem = ewk_context_menu_item_new_with_submenu(EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG, &quot;New Custom Item&quot;, true, subMenu);
+        // When context menu item is created using ewk_context_menu_item_new_with_submenu, it should not have parent menu.
+        EXPECT_EQ(0, ewk_context_menu_item_parent_menu_get(newItem));
+        ewk_context_menu_item_append(contextMenu, newItem);
</ins><span class="cx"> 
</span><del>-    // Context menu received from ewk_context_menu_item_submenu_get should be the same as one used to create sub menu.
-    EXPECT_EQ(subMenu, ewk_context_menu_item_submenu_get(newItem));
</del><ins>+        // Context menu received from ewk_context_menu_item_submenu_get should be the same as one used to create sub menu.
+        EXPECT_EQ(subMenu, ewk_context_menu_item_submenu_get(newItem));
</ins><span class="cx"> 
</span><del>-    // When context menu item is created using ewk_context_menu_item_new_with_submenu and added using ewk_context_menu_item_append it should have parent menu.
-    EXPECT_EQ(contextMenu, ewk_context_menu_item_parent_menu_get(newItem));
</del><ins>+        // When context menu item is created using ewk_context_menu_item_new_with_submenu and added using ewk_context_menu_item_append it should have parent menu.
+        EXPECT_EQ(contextMenu, ewk_context_menu_item_parent_menu_get(newItem));
</ins><span class="cx"> 
</span><del>-    Ewk_Context_Menu* subMenu2 = ewk_context_menu_new();
-    Ewk_Context_Menu_Item* newItem2 = ewk_context_menu_item_new_with_submenu(EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG, &quot;New Custom Item 2&quot;, true, subMenu2);
-    ewk_context_menu_item_append(contextMenu, newItem2);
</del><ins>+        Ewk_Context_Menu* subMenu2 = ewk_context_menu_new();
+        Ewk_Context_Menu_Item* newItem2 = ewk_context_menu_item_new_with_submenu(EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG, &quot;New Custom Item 2&quot;, true, subMenu2);
+        ewk_context_menu_item_append(contextMenu, newItem2);
</ins><span class="cx"> 
</span><del>-    EXPECT_TRUE(ewk_context_menu_item_select(ewk_context_menu_item_parent_menu_get(subMenuItem1), subMenuItem1));
</del><ins>+        EXPECT_TRUE(ewk_context_menu_item_select(ewk_context_menu_item_parent_menu_get(subMenuItem1), subMenuItem1));
</ins><span class="cx"> 
</span><del>-    ewk_context_menu_hide(ewk_context_menu_item_parent_menu_get(subMenuItem1));
</del><ins>+        ewk_context_menu_hide(ewk_context_menu_item_parent_menu_get(subMenuItem1));
</ins><span class="cx"> 
</span><del>-    return true;
-}
</del><ins>+        return true;
+    }
</ins><span class="cx"> 
</span><del>-static Eina_Bool hideContextMenu(Ewk_View_Smart_Data*)
-{
-    testFinished = true;
</del><ins>+    static Eina_Bool hideContextMenu(Ewk_View_Smart_Data*)
+    {
+        testFinished = true;
</ins><span class="cx"> 
</span><del>-    return true;
-}
</del><ins>+        return true;
+    }
+};
</ins><span class="cx"> 
</span><del>-TEST_F(EWK2UnitTestBase, ewk_context_menu_item_select)
</del><ins>+TEST_F(EWK2ContextMenuTest, ewk_context_menu_item_select)
</ins><span class="cx"> {
</span><span class="cx">     const char* itemSelectHTML =
</span><span class="cx">         &quot;&lt;html&gt;&quot;
</span><span class="lines">@@ -194,7 +197,7 @@
</span><span class="cx">     ASSERT_TRUE(waitUntilLoadFinished());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-TEST_F(EWK2UnitTestBase, ewk_context_menu_custom_items)
</del><ins>+TEST_F(EWK2ContextMenuTest, ewk_context_menu_custom_items)
</ins><span class="cx"> {
</span><span class="cx">     const char* itemSelectHTML =
</span><span class="cx">         &quot;&lt;html&gt;&quot;
</span></span></pre>
</div>
</div>

</body>
</html>