WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 151340
[EFL] http/tests/navigation/useragent test failed after
r192459
.
https://bugs.webkit.org/show_bug.cgi?id=151340
Summary
[EFL] http/tests/navigation/useragent test failed after r192459.
Hunseop Jeong
Reported
2015-11-16 22:09:23 PST
https://build.webkit.org/builders/EFL%20Linux%2064-bit%20Release%20WK2/builds/25581/steps/layout-test/logs/stdio
http/tests/navigation/useragent.php [ Failure ] 16 line in http/tests/navigation/useragent.php : document.write("UserAgent should match the " + userAgentTemplate + " template: " + !!userAgent.match(userAgentTemplateRegExp) + "<br>"); "!!userAgent.match(userAgentTemplateRegExp)" value is false after
r192459
. I checked the useragent value at whatsmyuseragent.com using miniBrowser. Result is "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/WEBKIT_MAJOR_VERSION.WEBKIT_MINOR_VERSION (KHTML, like Gecko) Version/8.0 Safari/601.2.7"
Attachments
Patch
(2.03 KB, patch)
2015-11-17 22:01 PST
,
Hunseop Jeong
no flags
Details
Formatted Diff
Diff
Patch
(2.03 KB, patch)
2015-11-17 22:04 PST
,
Hunseop Jeong
no flags
Details
Formatted Diff
Diff
Patch
(1.33 KB, patch)
2015-11-18 17:01 PST
,
Hunseop Jeong
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Hunseop Jeong
Comment 1
2015-11-17 22:01:32 PST
Created
attachment 265733
[details]
Patch
Hunseop Jeong
Comment 2
2015-11-17 22:02:10 PST
I think cause is that WEBKIT_MAJOR_VERSION and WEBKIT_MINOR_VERSION are recognized as string in #define MAKE_VERSION. So we need one more convert process that predefined value changes to string.
Hunseop Jeong
Comment 3
2015-11-17 22:04:14 PST
Created
attachment 265734
[details]
Patch
Gyuyoung Kim
Comment 4
2015-11-17 22:11:11 PST
Comment on
attachment 265734
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=265734&action=review
> Source/WebCore/platform/efl/UserAgentEfl.cpp:61 > +#define MAKE_VERSION(major, minor) MAKE_STRING(major) "." MAKE_STRING(minor)
I'm surprised we need to have additional step to convert from number to string. LGTM. However Darin might want to have a final look this fix before landing.
Hunseop Jeong
Comment 5
2015-11-18 00:16:29 PST
(In reply to
comment #4
)
> Comment on
attachment 265734
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=265734&action=review
> > > Source/WebCore/platform/efl/UserAgentEfl.cpp:61 > > +#define MAKE_VERSION(major, minor) MAKE_STRING(major) "." MAKE_STRING(minor) > > I'm surprised we need to have additional step to convert from number to > string. LGTM. > > However Darin might want to have a final look this fix before landing.
GTK already fixed it in
http://trac.webkit.org/changeset/192566
. But we can't fix this issue with KaLs' patch because EFL use the WEBKIT_MAJOR_VERSION and WEBKIT_MINOR_VERSION.
Darin Adler
Comment 6
2015-11-18 08:28:36 PST
Comment on
attachment 265734
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=265734&action=review
>>> Source/WebCore/platform/efl/UserAgentEfl.cpp:61 >>> +#define MAKE_VERSION(major, minor) MAKE_STRING(major) "." MAKE_STRING(minor) >> >> I'm surprised we need to have additional step to convert from number to string. LGTM. >> >> However Darin might want to have a final look this fix before landing. > > GTK already fixed it in
http://trac.webkit.org/changeset/192566
. > But we can't fix this issue with KaLs' patch because EFL use the WEBKIT_MAJOR_VERSION and WEBKIT_MINOR_VERSION.
I am not surprised. I remember needing to do this in the past. This patch looks right to me.
> Source/WebCore/platform/gtk/UserAgentGtk.cpp:120 > -#define MAKE_VERSION(major, minor) #major "." #minor > +#define MAKE_STRING(value) #value > +#define MAKE_VERSION(major, minor) MAKE_STRING(major) "." MAKE_STRING(minor) > return MAKE_VERSION(USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION); > +#undef MAKE_STRING > #undef MAKE_VERSION
This change isn’t needed; the GTK fix is fine for them.
Darin Adler
Comment 7
2015-11-18 08:29:22 PST
Comment on
attachment 265734
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=265734&action=review
>>>> Source/WebCore/platform/efl/UserAgentEfl.cpp:61 >>>> +#define MAKE_VERSION(major, minor) MAKE_STRING(major) "." MAKE_STRING(minor) >>> >>> I'm surprised we need to have additional step to convert from number to string. LGTM. >>> >>> However Darin might want to have a final look this fix before landing. >> >> GTK already fixed it in
http://trac.webkit.org/changeset/192566
. >> But we can't fix this issue with KaLs' patch because EFL use the WEBKIT_MAJOR_VERSION and WEBKIT_MINOR_VERSION. > > I am not surprised. I remember needing to do this in the past. This patch looks right to me.
I think maybe this can be done without the MAKE_VERSION macro. Might work just to do: return MAKE_STRING(WEBKIT_MAJOR_VERSION) "." MAKE_STRING(WEBKIT_MINOR_VERSION); Please give it a try!
Carlos Garcia Campos
Comment 8
2015-11-18 08:56:41 PST
Comment on
attachment 265734
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=265734&action=review
>> Source/WebCore/platform/gtk/UserAgentGtk.cpp:120 >> -#define MAKE_VERSION(major, minor) #major "." #minor >> +#define MAKE_STRING(value) #value >> +#define MAKE_VERSION(major, minor) MAKE_STRING(major) "." MAKE_STRING(minor) >> return MAKE_VERSION(USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION); >> +#undef MAKE_STRING >> #undef MAKE_VERSION > > This change isn’t needed; the GTK fix is fine for them.
Yes, please, don't changed this.
Darin Adler
Comment 9
2015-11-18 09:28:05 PST
Comment on
attachment 265734
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=265734&action=review
>>>>> Source/WebCore/platform/efl/UserAgentEfl.cpp:61 >>>>> +#define MAKE_VERSION(major, minor) MAKE_STRING(major) "." MAKE_STRING(minor) >>>> >>>> I'm surprised we need to have additional step to convert from number to string. LGTM. >>>> >>>> However Darin might want to have a final look this fix before landing. >>> >>> GTK already fixed it in
http://trac.webkit.org/changeset/192566
. >>> But we can't fix this issue with KaLs' patch because EFL use the WEBKIT_MAJOR_VERSION and WEBKIT_MINOR_VERSION. >> >> I am not surprised. I remember needing to do this in the past. This patch looks right to me. > > I think maybe this can be done without the MAKE_VERSION macro. Might work just to do: > > return MAKE_STRING(WEBKIT_MAJOR_VERSION) "." MAKE_STRING(WEBKIT_MINOR_VERSION); > > Please give it a try!
I looked this up and we definitely need two levels of macros. To quote the a gcc documentation page about this: “If you want to stringify the result of expansion of a macro argument, you have to use two levels of macros.” Too bad we got this wrong without testing it the first time. GTK didn’t need to change theirs to use strings :-(
Gyuyoung Kim
Comment 10
2015-11-18 16:43:54 PST
(In reply to
comment #9
)
> Too bad we got this wrong without testing it the first time. GTK didn’t need > to change theirs to use strings :-(
Yes, I should check if original change passes the test. Sorry about that.
Hunseop Jeong
Comment 11
2015-11-18 17:01:03 PST
Created
attachment 265812
[details]
Patch
Hunseop Jeong
Comment 12
2015-11-18 17:02:24 PST
(In reply to
comment #9
)
> Comment on
attachment 265734
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=265734&action=review
> > >>>>> Source/WebCore/platform/efl/UserAgentEfl.cpp:61 > >>>>> +#define MAKE_VERSION(major, minor) MAKE_STRING(major) "." MAKE_STRING(minor) > >>>> > >>>> I'm surprised we need to have additional step to convert from number to string. LGTM. > >>>> > >>>> However Darin might want to have a final look this fix before landing. > >>> > >>> GTK already fixed it in
http://trac.webkit.org/changeset/192566
. > >>> But we can't fix this issue with KaLs' patch because EFL use the WEBKIT_MAJOR_VERSION and WEBKIT_MINOR_VERSION. > >> > >> I am not surprised. I remember needing to do this in the past. This patch looks right to me. > > > > I think maybe this can be done without the MAKE_VERSION macro. Might work just to do: > > > > return MAKE_STRING(WEBKIT_MAJOR_VERSION) "." MAKE_STRING(WEBKIT_MINOR_VERSION); > > > > Please give it a try! > > I looked this up and we definitely need two levels of macros. To quote the a > gcc documentation page about this: “If you want to stringify the result of > expansion of a macro argument, you have to use two levels of macros.” >
I change it to use the two levels of macro.
WebKit Commit Bot
Comment 13
2015-11-19 10:31:27 PST
Comment on
attachment 265812
[details]
Patch Clearing flags on attachment: 265812 Committed
r192634
: <
http://trac.webkit.org/changeset/192634
>
WebKit Commit Bot
Comment 14
2015-11-19 10:31:32 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug