<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>132939</bug_id>
          
          <creation_ts>2014-05-14 20:44:23 -0700</creation_ts>
          <short_desc>[WebKit2-EFL] Fix safety check failed errors in API tests</short_desc>
          <delta_ts>2014-05-29 21:03:08 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit EFL</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>REMIND</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>132813</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Shivakumar J M">shiva.jm</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bunhere</cc>
    
    <cc>cdumez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>lucas.de.marchi</cc>
    
    <cc>ryuan.choi</cc>
    
    <cc>sergio</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1009423</commentid>
    <comment_count>0</comment_count>
    <who name="Shivakumar J M">shiva.jm</who>
    <bug_when>2014-05-14 20:44:23 -0700</bug_when>
    <thetext>Fix erros in below API tests, ewk_context_additional_plugin_path_set(), ewk_view_contents_size_get(), ewk_context_menu_item_select(), ewk_view_script_execute().

[ RUN      ] EWK2ContextTest.ewk_context_additional_plugin_path_set
ERR&lt;9873&gt;: /home/shiva.jm/webkit-git/svngitmay14/WebKit/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:490 ewk_context_additional_plugin_path_set() safety check failed: path == NULL
[       OK ] EWK2ContextTest.ewk_context_additional_plugin_path_set (131 ms)
[----------] 12 tests from EWK2ContextTest (11581 ms total)


[ RUN      ] EWK2ViewTest.ewk_view_contents_size_get
ERR&lt;11319&gt;: /home/shiva.jm/webkit-git/svngitmay14/WebKit/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:54 toEwkViewChecked() safety check failed: evasObject == NULL
CRI&lt;11319&gt;: /home/shiva.jm/webkit-git/svngitmay14/WebKit/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:763 ewk_view_contents_size_get() no private data for object (nil)
[       OK ] EWK2ViewTest.ewk_view_contents_size_get (790 ms)
[----------] 36 tests from EWK2ViewTest (29847 ms total)

[----------] 1 test from EWK2UnitTestBase
[ RUN      ] EWK2UnitTestBase.ewk_view_script_execute
ERR&lt;11319&gt;: /home/shiva.jm/webkit-git/svngitmay14/WebKit/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:692 ewk_view_script_execute() safety check failed: script == NULL
[       OK ] EWK2UnitTestBase.ewk_view_script_execute (675 ms)

Expected: true
ERR&lt;11033&gt;: /home/shiva.jm/webkit-git/svngitmay14/WebKit/Source/WebKit2/UIProcess/API/efl/ewk_context_menu.cpp:158 ewk_context_menu_item_select() safety check failed: item == NULL
/home/shiva.jm/webkit-git/svngitmay14/WebKit/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:167: Failure
Value of: text
  Actual: &quot;aa&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1009497</commentid>
    <comment_count>1</comment_count>
      <attachid>231498</attachid>
    <who name="Shivakumar J M">shiva.jm</who>
    <bug_when>2014-05-15 04:30:14 -0700</bug_when>
    <thetext>Created attachment 231498
Patch

ewk_view_contents_size_get unit test has tested unsupported evas object type. But ewk APIs gives critical error, when given evas object
is not ewk type. So, we can&apos;t test wrong evas object type by using current test. so Removing the test line.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1009666</commentid>
    <comment_count>2</comment_count>
      <attachid>231498</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2014-05-15 17:13:11 -0700</bug_when>
    <thetext>Comment on attachment 231498
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=231498&amp;action=review

&gt; Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-1146
&gt; -    ewk_view_contents_size_get(0, &amp;contentsWidth, &amp;contentsHeight);

I think this is to check if width and height can be initialized with 0 when Evas_Object is null. To be honest, I don&apos;t know why we have to initialize width/height when evas object is null.

Eina_Bool ewk_view_contents_size_get(const Evas_Object* ewkView, Evas_Coord* width, Evas_Coord* height)
{
    EwkView* impl = toEwkViewChecked(ewkView);
    if (EINA_UNLIKELY(!impl)) {
        EINA_LOG_CRIT(&quot;no private data for object %p&quot;, ewkView);
        if (width)
            *width = 0;
        if (height)
            *height = 0;

        return false;
    }

If we remove this test logic, I think we have to remove the initialization code together.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1009672</commentid>
    <comment_count>3</comment_count>
      <attachid>231498</attachid>
    <who name="Ryuan Choi">ryuan.choi</who>
    <bug_when>2014-05-15 17:35:32 -0700</bug_when>
    <thetext>Comment on attachment 231498
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=231498&amp;action=review

&gt; Source/WebKit2/ChangeLog:9
&gt; +        ewk_view_contents_size_get unit test has tested unsupported evas object type. But ewk APIs gives critical error, when given evas object
&gt; +        is not ewk type. So, we can&apos;t test wrong evas object type by using current test. so Removing the test line.

I am not sure what is the problem. It is intentionally tested.

&gt;&gt; Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-1146
&gt;&gt; -    ewk_view_contents_size_get(0, &amp;contentsWidth, &amp;contentsHeight);
&gt; 
&gt; I think this is to check if width and height can be initialized with 0 when Evas_Object is null. To be honest, I don&apos;t know why we have to initialize width/height when evas object is null.
&gt; 
&gt; Eina_Bool ewk_view_contents_size_get(const Evas_Object* ewkView, Evas_Coord* width, Evas_Coord* height)
&gt; {
&gt;     EwkView* impl = toEwkViewChecked(ewkView);
&gt;     if (EINA_UNLIKELY(!impl)) {
&gt;         EINA_LOG_CRIT(&quot;no private data for object %p&quot;, ewkView);
&gt;         if (width)
&gt;             *width = 0;
&gt;         if (height)
&gt;             *height = 0;
&gt; 
&gt;         return false;
&gt;     }
&gt; 
&gt; If we remove this test logic, I think we have to remove the initialization code together.

Maybe, I don&apos;t have objection about removing the logic that clears the value.
But I still want test case although we remove this logic.

This test case explains the behavior of ewebkit well when wrong ewkView is given.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1009673</commentid>
    <comment_count>4</comment_count>
    <who name="Ryuan Choi">ryuan.choi</who>
    <bug_when>2014-05-15 17:37:54 -0700</bug_when>
    <thetext>If you want clear log, it looks better to turn off the EINA_LOG for our test cases.

Test cases should cover not only positive cases but also negative cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1009674</commentid>
    <comment_count>5</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2014-05-15 17:40:55 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; If you want clear log, it looks better to turn off the EINA_LOG for our test cases.
&gt; 
&gt; Test cases should cover not only positive cases but also negative cases.

How about turning on EINA_LOG only when debug mode ? Personally I hope to see the message on debug mode. ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1012564</commentid>
    <comment_count>6</comment_count>
    <who name="Shivakumar J M">shiva.jm</who>
    <bug_when>2014-05-29 21:03:08 -0700</bug_when>
    <thetext>I would like to postpone to fix this problem later, since to remove error logs for negative test, we may need to seperate negative tests or enable error logs in debug mode only</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>231498</attachid>
            <date>2014-05-15 04:30:14 -0700</date>
            <delta_ts>2014-05-15 17:35:32 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-132939.patch</filename>
            <type>text/plain</type>
            <size>1649</size>
            <attacher name="Shivakumar J M">shiva.jm</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
S2l0Mi9DaGFuZ2VMb2cJKHJldmlzaW9uIDE2ODg5NikKKysrIFNvdXJjZS9XZWJLaXQyL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBACisyMDE0LTA1LTE1ICBTaGl2YWt1
bWFyIEpNICA8c2hpdmEuam1Ac2Ftc3VuZy5jb20+CisKKyAgICAgICAgW1dlYktpdDItRUZMXSBG
aXggc2FmZXR5IGNoZWNrIGZhaWxlZCBlcnJvcnMgaW4gQVBJIHRlc3RzCisgICAgICAgIGh0dHBz
Oi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMzI5MzkKKworICAgICAgICBSZXZp
ZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBld2tfdmlld19jb250ZW50c19zaXpl
X2dldCB1bml0IHRlc3QgaGFzIHRlc3RlZCB1bnN1cHBvcnRlZCBldmFzIG9iamVjdCB0eXBlLiBC
dXQgZXdrIEFQSXMgZ2l2ZXMgY3JpdGljYWwgZXJyb3IsIHdoZW4gZ2l2ZW4gZXZhcyBvYmplY3QK
KyAgICAgICAgaXMgbm90IGV3ayB0eXBlLiBTbywgd2UgY2FuJ3QgdGVzdCB3cm9uZyBldmFzIG9i
amVjdCB0eXBlIGJ5IHVzaW5nIGN1cnJlbnQgdGVzdC4gc28gUmVtb3ZpbmcgdGhlIHRlc3QgbGlu
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W50c0hlaWdodCk7CiAKICAgICBBU1NFUlRfVFJVRShsb2FkVXJsU3luYyhlbnZp
cm9ubWVudC0+ZGVmYXVsdFRlc3RQYWdlVXJsKCkpKTsKICAgICBld2tfdmlld19jb250ZW50c19z
aXplX2dldCh3ZWJWaWV3KCksICZjb250ZW50c1dpZHRoLCAmY29udGVudHNIZWlnaHQpOwo=
</data>
<flag name="review"
          id="255951"
          type_id="1"
          status="-"
          setter="gyuyoung.kim"
    />
    <flag name="commit-queue"
          id="255952"
          type_id="3"
          status="-"
          setter="gyuyoung.kim"
    />
          </attachment>
      

    </bug>

</bugzilla>