Bug 92010 - [Chromium] Move layoutTestMode to WebCore
Summary: [Chromium] Move layoutTestMode to WebCore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Pilgrim (Google)
URL:
Keywords:
Depends on: 92082
Blocks: 82948
  Show dependency treegraph
 
Reported: 2012-07-23 10:45 PDT by Mark Pilgrim (Google)
Modified: 2012-07-24 01:54 PDT (History)
11 users (show)

See Also:


Attachments
Patch (41.99 KB, patch)
2012-07-23 10:46 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff
Patch (41.70 KB, patch)
2012-07-23 11:56 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff
Patch (41.73 KB, patch)
2012-07-23 19:34 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Pilgrim (Google) 2012-07-23 10:45:42 PDT
[Chromium] Move layoutTestMode to WebCore
Comment 1 Mark Pilgrim (Google) 2012-07-23 10:46:33 PDT
Created attachment 153818 [details]
Patch
Comment 2 Mark Pilgrim (Google) 2012-07-23 10:47:31 PDT
Does not currently compile.
Comment 3 Mark Pilgrim (Google) 2012-07-23 10:55:33 PDT
Correction: compiles, does not link.


out/Release/../../Source/WebKit/chromium/third_party/gold/gold64: out/Release/obj.target/Source/WebKit/chromium/libwebkit.a(out/Release/obj.target/Source/WebKit/chromium/../../../webkit/Source/WebKit/chromium/src/WebKit.o): in function WebKit::setLayoutTestMode(bool):WebKit.cpp(.text._ZN6WebKit17setLayoutTestModeEb+0x5): error: undefined reference to 'WebCore::LayoutTestMode::setLayoutTestMode(bool)' 
out/Release/../../Source/WebKit/chromium/third_party/gold/gold64: out/Release/obj.target/Source/WebCore/WebCore.gyp/libwebcore_rendering.a(out/Release/obj.target/Source/WebCore/WebCore.gyp/../../../webcore_rendering/Source/WebCore/rendering/RenderThemeChromiumSkia.o): in function WebCore::RenderThemeChromiumSkia::caretBlinkInterval() const:RenderThemeChromiumSkia.cpp(.text._ZNK7WebCore23RenderThemeChromiumSkia18caretBlinkIntervalEv+0x5): error: undefined reference to 'WebCore::LayoutTestMode::layoutTestMode()'
collect2: ld returned 1 exit status
make: *** [out/Release/TestWebKitAPI] Error 1
zsh: exit 2     Tools/Scripts/build-webkit --chromium


And other such niceness.
Comment 4 Ryosuke Niwa 2012-07-23 11:09:02 PDT
I don't think we should be moving a class about layout test into WebCore. That to me is a layer violation.
Comment 5 Adam Barth 2012-07-23 11:11:58 PDT
Comment on attachment 153818 [details]
Patch

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

> Source/WebCore/platform/LayoutTestMode.h:39
> +class LayoutTestMode {
> +public:
> +    static bool layoutTestMode();
> +    static void setLayoutTestMode(bool);

We don't really need this class wrapper.  We can just have layoutTestMode() and setLayoutTestMode() exist in the WebCore namespace.

> Source/WebCore/platform/LayoutTestMode.h:44
> +    static bool isLayoutTestModeEnabled;

In that approach, this can just be a static in the LayoutTestMode.cpp file.

We might take this opportunity to rename these functions to isRunningLayoutTest() or something else more WebKity.
Comment 6 Adam Barth 2012-07-23 11:13:25 PDT
Comment on attachment 153818 [details]
Patch

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

> Source/WebCore/WebCore.gypi:290
> +            'platform/LayoutTestMode.h',

Looks like you didn't add platform/LayoutTestMode.cpp to WebCore.gypi, which is likely what's causing your linking trouble.
Comment 7 WebKit Review Bot 2012-07-23 11:30:28 PDT
Comment on attachment 153818 [details]
Patch

Attachment 153818 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13329107
Comment 8 Darin Fisher (:fishd, Google) 2012-07-23 11:45:12 PDT
(In reply to comment #4)
> I don't think we should be moving a class about layout test into WebCore. That to me is a layer violation.

This is not a new dependency.  You can see that in the Chromium port, WebCore already knows about this "layout test" boolean.  Mark is just moving it from one spot in WebCore to another.
Comment 9 Mark Pilgrim (Google) 2012-07-23 11:56:28 PDT
Created attachment 153826 [details]
Patch
Comment 10 Mark Pilgrim (Google) 2012-07-23 11:57:20 PDT
(In reply to comment #5)
> (From update of attachment 153818 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=153818&action=review
> 
> > Source/WebCore/platform/LayoutTestMode.h:39
> > +class LayoutTestMode {
> > +public:
> > +    static bool layoutTestMode();
> > +    static void setLayoutTestMode(bool);
> 
> We don't really need this class wrapper.

Removed in latest patch.

> 
> > Source/WebCore/platform/LayoutTestMode.h:44
> > +    static bool isLayoutTestModeEnabled;
> 
> In that approach, this can just be a static in the LayoutTestMode.cpp file.
> 
> We might take this opportunity to rename these functions to isRunningLayoutTest() or something else more WebKity.

Renamed in latest patch.
Comment 11 Mark Pilgrim (Google) 2012-07-23 11:57:55 PDT
(In reply to comment #6)
> (From update of attachment 153818 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=153818&action=review
> 
> > Source/WebCore/WebCore.gypi:290
> > +            'platform/LayoutTestMode.h',
> 
> Looks like you didn't add platform/LayoutTestMode.cpp to WebCore.gypi, which is likely what's causing your linking trouble.

Thanks. Added in latest patch.
Comment 12 Adam Barth 2012-07-23 13:28:43 PDT
Comment on attachment 153826 [details]
Patch

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

> Source/WebCore/platform/LayoutTestMode.h:32
> +#ifndef LayoutTestMode_h
> +#define LayoutTestMode_h

I wonder if LayoutTestMode.h is still the right name for this header...  Perhaps LayoutTestSupport.h (just LayoutTest.h doesn't seem right)?  Sorry to be so nit-picky about the names.  If you want to land it with this name, that's fine too.
Comment 13 Mark Pilgrim (Google) 2012-07-23 19:34:06 PDT
Created attachment 153939 [details]
Patch
Comment 14 Mark Pilgrim (Google) 2012-07-23 19:34:49 PDT
Comment on attachment 153939 [details]
Patch

Renamed to LayoutTestSupport.
Comment 15 WebKit Review Bot 2012-07-23 22:05:47 PDT
Comment on attachment 153939 [details]
Patch

Clearing flags on attachment: 153939

Committed r123424: <http://trac.webkit.org/changeset/123424>
Comment 16 WebKit Review Bot 2012-07-23 22:05:54 PDT
All reviewed patches have been landed.  Closing bug.