Bug 85209 - [EFL] Remove unnecessary extra call to set developer extras setting on the test startup
Summary: [EFL] Remove unnecessary extra call to set developer extras setting on the te...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sudarsana Nagineni (babu)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-30 10:50 PDT by Sudarsana Nagineni (babu)
Modified: 2012-05-24 22:00 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.61 KB, patch)
2012-04-30 11:31 PDT, Sudarsana Nagineni (babu)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sudarsana Nagineni (babu) 2012-04-30 10:50:23 PDT
enable_developer_extras_set() called twice on the test startup. Calling this function with wrong value from resetDefaultsToConsistentValues()is unnecessary because the same function with the correct value called again from createLayoutTestController().
Comment 1 Sudarsana Nagineni (babu) 2012-04-30 11:31:24 PDT
Created attachment 139489 [details]
Patch

Remove an unnecessary extra call enable_developer_extras_set().
Comment 2 Gyuyoung Kim 2012-05-01 22:56:48 PDT
Comment on attachment 139489 [details]
Patch

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

> Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:-228
> -    ewk_view_setting_enable_developer_extras_set(browser->mainView(), EINA_FALSE);

I think we need to keep this developer extras setting in this function. Although resetDefaultsToConsistentValues() is only called by runTest in EFL DRT, other functions is able to call this function. I think we need to modify why we set developer_extras_set as true regardless of inspector tests. I think we can only enable this option when test is for inspector.
Comment 3 Gyuyoung Kim 2012-05-02 04:15:18 PDT
In GTK port case, they have a function to check if developer extras option is enabled. But, they don't check it as below,

static bool shouldEnableDeveloperExtras(const string& pathOrURL)
{
    return true;
}

I take a look what is developer_extra option. It seems the option is used by inspector and to support additional features. For example, message is shown on console or support worker thread on inspector and so on. I'm still thinking we can enable this feature when we run test regarding inspector. It look other ports  just enable this feature regardless of inspector.

By the way, I think resetDefaultsToConsistentValues() is to reset all options. So, IMO, developerExtras option needs to be set as false by default. If other places wanna reset all options by this function, we can't set it as false by this patch.
Comment 4 Sudarsana Nagineni (babu) 2012-05-02 06:03:32 PDT
(In reply to comment #3)
> In GTK port case, they have a function to check if developer extras option is enabled. But, they don't check it as below,
> 
> static bool shouldEnableDeveloperExtras(const string& pathOrURL)
> {
>     return true;
> }
> 
> I take a look what is developer_extra option. It seems the option is used by inspector and to support additional features. For example, message is shown on console or support worker thread on inspector and so on. I'm still thinking we can enable this feature when we run test regarding inspector. It look other ports  just enable this feature regardless of inspector.

Initially, other ports had a check that enables developer extras only for tests that have inspector-enabled/ in their path. But, the following commit removed the condition and enabled the setting always in DRT.
http://trac.webkit.org/changeset/72366

> 
> By the way, I think resetDefaultsToConsistentValues() is to reset all options. So, IMO, developerExtras option needs to be set as false by default. If other places wanna reset all options by this function, we can't set it as false by this patch.

Currently resetDefaultsToConsistentValues() is getting called only on the test startup. So, I thought it's an unnecessary to set the setting FALSE first and change to TRUE again on the test startup. As this is a trivial case, I can keep this as it is, if you think we might use reset*() function in other places to reset the values.
Comment 5 Raphael Kubo da Costa (:rakuco) 2012-05-02 07:45:52 PDT
Interesting, I had not noticed we sort of reset the settings in two different places (createLTC and resetDefaultsToConsistentValues). I understand Gyuyoung's concern, however the way I see it is that after the commit Sudarsana pointed out we always need to enable developer extras and we currently effectively have two contradicting calls immediately following each other, so we either just leave the call in createLTC as it is or remove it and pass EINA_TRUE to the ewk_view_setting call in resetDefaults. I tend to favour the former just to make the API more similar to the one used by other ports so changes such as the very one cited by Sudarsana can be made more easily in the future.
Comment 6 Gyuyoung Kim 2012-05-21 01:39:33 PDT
If DRT needs to enable/disable developer_extras_set during the layout test, I'm still thinking we need to keep ewk_view_setting_enable_developer_extras_set(browser->mainView(), EINA_FALSE); in resetDefaultsToConsistentValues(). But, as Sudarsana said, if this option needs to be turned on always, I agree with submitting patch for now.

Kubo, is this similar your opinion ?
Comment 7 Raphael Kubo da Costa (:rakuco) 2012-05-23 09:48:46 PDT
(In reply to comment #6)
> If DRT needs to enable/disable developer_extras_set during the layout test, I'm still thinking we need to keep ewk_view_setting_enable_developer_extras_set(browser->mainView(), EINA_FALSE); in resetDefaultsToConsistentValues(). But, as Sudarsana said, if this option needs to be turned on always, I agree with submitting patch for now.
> 
> Kubo, is this similar your opinion ?

Yes. Right now we're duplicating calls already made in createLTC(). If we remove that, we can even get rid of a FIXME I added in r117540.
Comment 8 Antonio Gomes 2012-05-24 21:52:39 PDT
Comment on attachment 139489 [details]
Patch

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

> Tools/ChangeLog:9
> +        an unnecessary extra call which set wrong value. 

sets
Comment 9 WebKit Review Bot 2012-05-24 22:00:36 PDT
Comment on attachment 139489 [details]
Patch

Clearing flags on attachment: 139489

Committed r118473: <http://trac.webkit.org/changeset/118473>
Comment 10 WebKit Review Bot 2012-05-24 22:00:48 PDT
All reviewed patches have been landed.  Closing bug.