Bug 114897

Summary: [EFL] Add unit test cases for ewk_settings APIs
Product: WebKit Reporter: Jose Lejin PJ <jose.lejin>
Component: WebKit EFLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, gyuyoung.kim, lucas.de.marchi, rakuco, suneshgopinath
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 115151    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Jose Lejin PJ 2013-04-19 23:07:18 PDT
In /trunk/Source/WebKit/efl/tests/test_ewk_setting.cpp unit test cases to be added for all APIs in ewk_settings(WK1)
Comment 1 Jose Lejin PJ 2013-04-20 02:52:54 PDT
Created attachment 198936 [details]
Patch

Unit tests for needed APIs
Comment 2 Jinwoo Song 2013-04-22 17:13:56 PDT
Comment on attachment 198936 [details]
Patch

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

> Source/WebKit/efl/tests/test_ewk_setting.cpp:39
> +    ASSERT_EQ(ewk_settings_web_database_default_quota_get(), 1 * 1024 * 1024);

Expected value should be at first and actual value should be followed.
https://code.google.com/p/googletest/wiki/Primer

> Source/WebKit/efl/tests/test_ewk_setting.cpp:42
> +    ASSERT_EQ(ewk_settings_web_database_default_quota_get(), 2 * 1024 * 1024);

ditto.

> Source/WebKit/efl/tests/test_ewk_setting.cpp:45
> +    ASSERT_EQ(ewk_settings_web_database_default_quota_get(), 3 * 1024 * 1024);

ditto.
Comment 3 Gyuyoung Kim 2013-04-22 20:43:52 PDT
Comment on attachment 198936 [details]
Patch

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

> Source/WebKit/efl/tests/test_ewk_setting.cpp:137
> +    ewk_settings_object_cache_enable_set(EINA_FALSE);

IIRC, we decided to use standard boolean in API test.

> Source/WebKit/efl/tests/test_ewk_setting.cpp:140
> +    ewk_settings_object_cache_enable_set(EINA_TRUE);

ditto.

> Source/WebKit/efl/tests/test_ewk_setting.cpp:151
> +    ewk_settings_shadow_dom_enable_set(EINA_TRUE);

ditto.

> Source/WebKit/efl/tests/test_ewk_setting.cpp:154
> +    ewk_settings_shadow_dom_enable_set(EINA_FALSE);

ditto.
Comment 4 Jose Lejin PJ 2013-04-22 22:06:23 PDT
Thanks for review Jinwoo Song/Gyuyoung Kim. I will update the patch.
Comment 5 Jose Lejin PJ 2013-04-22 23:43:32 PDT
Created attachment 199156 [details]
Patch

Updated as per review
Comment 6 Gyuyoung Kim 2013-04-24 03:00:10 PDT
Comment on attachment 199156 [details]
Patch

LGTM.
Comment 7 Jose Lejin PJ 2013-04-24 05:05:33 PDT
Comment on attachment 199156 [details]
Patch

requesting for cq.
Comment 8 WebKit Commit Bot 2013-04-24 06:52:28 PDT
The commit-queue encountered the following flaky tests while processing attachment 199156 [details]:

media/video-played-collapse.html bug 58630 (authors: annacc@chromium.org, jamesr@chromium.org, pnormand@igalia.com, and vrk@chromium.org)
transitions/color-transition-rounding.html bug 114182 (author: simon.fraser@apple.com)
transitions/cubic-bezier-overflow-svg-length.html bug 114183 (author: peter@chromium.org)
transitions/interrupt-zero-duration.html bug 114184 (authors: cmarrin@apple.com, rniwa@webkit.org, and simon.fraser@apple.com)
transitions/multiple-background-transitions.html bug 114185 (author: simon.fraser@apple.com)
transitions/cubic-bezier-overflow-color.html bug 114186 (author: peter@chromium.org)
transitions/multiple-shadow-transitions.html bug 114187 (author: simon.fraser@apple.com)
transitions/mismatched-shadow-transitions.html bug 114188 (author: simon.fraser@apple.com)
transitions/color-transition-all.html bug 114189 (authors: ossy@webkit.org and simon.fraser@apple.com)
transitions/negative-delay.html bug 114190 (author: simon.fraser@apple.com)
transitions/cubic-bezier-overflow-shadow.html bug 114191 (author: peter@chromium.org)
transitions/min-max-width-height-transitions.html bug 114192 (author: simon.fraser@apple.com)
transitions/cancel-transition.html bug 114193 (authors: ojan@chromium.org, rniwa@webkit.org, and simon.fraser@apple.com)
transitions/border-radius-transition.html bug 114194 (author: simon.fraser@apple.com)
transitions/flex-transitions.html bug 114195 (author: tony@chromium.org)
transitions/mixed-type.html bug 114196 (author: mikelawther@chromium.org)
transitions/multiple-mask-transitions.html bug 114197 (author: simon.fraser@apple.com)
transitions/color-transition-premultiplied.html bug 114198 (author: simon.fraser@apple.com)
transitions/mismatched-shadow-styles.html bug 114199 (author: simon.fraser@apple.com)
transitions/mask-transitions.html bug 114200 (authors: ojan@chromium.org, oliver@apple.com, and simon.fraser@apple.com)
transitions/cubic-bezier-overflow-length.html bug 114201 (author: peter@chromium.org)
transitions/multiple-background-size-transitions.html bug 114202 (authors: mitz@webkit.org and simon.fraser@apple.com)
transitions/clip-transition.html bug 114203 (authors: dglazkov@chromium.org and simon.fraser@apple.com)
transitions/cubic-bezier-overflow-transform.html bug 114204 (author: peter@chromium.org)
transitions/interrupted-accelerated-transition.html bug 56242 (authors: rniwa@webkit.org, simon.fraser@apple.com, and tonyg@chromium.org)
transitions/background-transitions.html bug 114206 (author: simon.fraser@apple.com)
http/tests/security/cookies/third-party-cookie-blocking-user-action.html bug 114511 (authors: ap@webkit.org, jochen@chromium.org, and rniwa@webkit.org)
http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html bug 114208 (authors: abarth@webkit.org and rniwa@webkit.org)
fast/loader/javascript-url-in-object.html bug 114210 (authors: rniwa@webkit.org and sam@webkit.org)
platform/mac/editing/deleting/deletionUI-single-instance.html bug 114181 (author: rniwa@webkit.org)
The commit-queue is continuing to process your patch.
Comment 9 WebKit Commit Bot 2013-04-24 06:53:19 PDT
Comment on attachment 199156 [details]
Patch

Clearing flags on attachment: 199156

Committed r149032: <http://trac.webkit.org/changeset/149032>
Comment 10 WebKit Commit Bot 2013-04-24 06:53:23 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 WebKit Commit Bot 2013-04-25 00:31:37 PDT
Re-opened since this is blocked by bug 115151
Comment 12 Gyuyoung Kim 2013-04-25 00:46:50 PDT
Though WebKit doesn't like to roll out, I did it because of API test failing.

http://build.webkit.org/builders/EFL%20Linux%2064-bit%20Release/builds/11912

This patch used wrong default storage path, and also didn't consider $HOME path. Sorry for missing it.
Comment 13 Jose Lejin PJ 2013-04-25 04:14:49 PDT
Created attachment 199649 [details]
Patch

Updated with correct default path
Comment 14 Jose Lejin PJ 2013-04-25 21:40:30 PDT
Created attachment 199778 [details]
Patch

Updated patch
Comment 15 Gyuyoung Kim 2013-04-25 22:50:23 PDT
Comment on attachment 199778 [details]
Patch

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

> Source/WebKit/efl/tests/test_ewk_setting.cpp:55
> +    strncpy(defaultPath, getenv("HOME"), sizeof(defaultPath));   

How about below case ?

 char* homePath = getenv("HOME");
 char* defaultPath = reinterpret_cast<char*>(malloc(strlen(homePath) + strlen("/.cache/WebKitEfl/Databases") + 1));
 strncpy(defaultPath, homePath, strlen(homePath) + 1);

> Source/WebKit/efl/tests/test_ewk_setting.cpp:82
> +    strncpy(defaultPath, getenv("HOME"), sizeof(defaultPath));   

ditto ?

> Source/WebKit/efl/tests/test_ewk_setting.cpp:112
> +    strncpy(defaultPath, getenv("HOME"), sizeof(defaultPath));   

ditto ?
Comment 16 Jose Lejin PJ 2013-04-26 00:21:06 PDT
Created attachment 199791 [details]
Patch

Updated patch
Comment 17 Gyuyoung Kim 2013-04-26 01:22:28 PDT
Comment on attachment 199791 [details]
Patch

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

> Source/WebKit/efl/tests/test_ewk_setting.cpp:54
> +    char* defaultPath = reinterpret_cast<char*>(malloc(strlen(homePath) + strlen("/.cache/WebKitEfl/Databases") + 1));

Missing free() ?

> Source/WebKit/efl/tests/test_ewk_setting.cpp:84
> +    char* defaultPath = reinterpret_cast<char*>(malloc(strlen(homePath) + strlen("/.local/share/WebKitEfl/LocalStorage") + 1));

ditto.

> Source/WebKit/efl/tests/test_ewk_setting.cpp:116
> +    char* defaultPath = reinterpret_cast<char*>(malloc(strlen(homePath) + strlen("/.cache/WebKitEfl/Applications") + 1));

ditto.
Comment 18 Jose Lejin PJ 2013-04-26 02:15:04 PDT
(In reply to comment #17)
> (From update of attachment 199791 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=199791&action=review
> 
> > Source/WebKit/efl/tests/test_ewk_setting.cpp:54
> > +    char* defaultPath = reinterpret_cast<char*>(malloc(strlen(homePath) + strlen("/.cache/WebKitEfl/Databases") + 1));
> 
> Missing free() ?

sorry :) Will correct it.
Comment 19 Jose Lejin PJ 2013-04-26 02:26:53 PDT
Created attachment 199806 [details]
Patch

Updated patch
Comment 20 Gyuyoung Kim 2013-04-26 02:48:58 PDT
Comment on attachment 199806 [details]
Patch

LGTM now. Please land this patch after verifying to run WK1 API test.
Comment 21 Jose Lejin PJ 2013-04-26 03:00:33 PDT
Comment on attachment 199806 [details]
Patch

Tested all API unit tests. Pass 10/10.
Comment 22 WebKit Commit Bot 2013-04-26 03:29:30 PDT
Comment on attachment 199806 [details]
Patch

Clearing flags on attachment: 199806

Committed r149174: <http://trac.webkit.org/changeset/149174>
Comment 23 WebKit Commit Bot 2013-04-26 03:29:34 PDT
All reviewed patches have been landed.  Closing bug.