Bug 102676 - [chromium] move methods that only use the WebKit API from DRTTestRunner to TestRunner
Summary: [chromium] move methods that only use the WebKit API from DRTTestRunner to Te...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: jochen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-19 04:37 PST by jochen
Modified: 2012-11-19 12:06 PST (History)
3 users (show)

See Also:


Attachments
Patch (87.89 KB, patch)
2012-11-19 04:41 PST, jochen
no flags Details | Formatted Diff | Diff
Patch (87.98 KB, patch)
2012-11-19 11:29 PST, jochen
no flags Details | Formatted Diff | Diff
Patch for landing (88.03 KB, patch)
2012-11-19 11:41 PST, jochen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2012-11-19 04:37:01 PST
[chromium] move methods that only use the WebKit API from DRTTestRunner to TestRunner
Comment 1 jochen 2012-11-19 04:41:47 PST
Created attachment 174954 [details]
Patch
Comment 2 Tony Chang 2012-11-19 09:16:10 PST
Comment on attachment 174954 [details]
Patch

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

> Tools/ChangeLog:12
> +        In addition, I've replaced parsePageNumber with the more commonly used
> +        cppVariantToInt32, changed logErrorToConsole to just print the error
> +        message instead of logging a real console error, moved abortModal to
> +        the list of stubbed out methods, and removed
> +        setAutomaticLinkDetectionEnabled which wasn't used anywhere.

The ChangeLog section below is normally where you put comments like this.  This section is normally about why you are making this change.

> Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:732
> +void TestRunner::logErrorToConsole(const string& text)
> +{
> +    m_delegate->printMessage(string("CONSOLE MESSAGE: JavaScript ERROR: ") + text + "\n");
> +}

Does this always produce messages in the same order if the test has a mix of console.log and calls that might go through here?  I guess in practice, no test should go through this code path (i.e., will any tests fail if you change the output format and remove the prefix)?  

It's a bit confusing to name this logErrorToConsole when it's not actually logging an error to the javascript console.  Maybe rename it to something like "printErrorMessage"?
Comment 3 jochen 2012-11-19 11:29:22 PST
Created attachment 175011 [details]
Patch
Comment 4 jochen 2012-11-19 11:30:59 PST
(In reply to comment #2)
> (From update of attachment 174954 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=174954&action=review
> 
> > Tools/ChangeLog:12
> > +        In addition, I've replaced parsePageNumber with the more commonly used
> > +        cppVariantToInt32, changed logErrorToConsole to just print the error
> > +        message instead of logging a real console error, moved abortModal to
> > +        the list of stubbed out methods, and removed
> > +        setAutomaticLinkDetectionEnabled which wasn't used anywhere.
> 
> The ChangeLog section below is normally where you put comments like this.  This section is normally about why you are making this change.

I've moved the comment about logErrorToConsole down to the function list. The other comments refer to deleted code which is not listed below, so I left them here

> 
> > Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:732
> > +void TestRunner::logErrorToConsole(const string& text)
> > +{
> > +    m_delegate->printMessage(string("CONSOLE MESSAGE: JavaScript ERROR: ") + text + "\n");
> > +}
> 
> Does this always produce messages in the same order if the test has a mix of console.log and calls that might go through here?  I guess in practice, no test should go through this code path (i.e., will any tests fail if you change the output format and remove the prefix)?  

Yes and yes.

> 
> It's a bit confusing to name this logErrorToConsole when it's not actually logging an error to the javascript console.  Maybe rename it to something like "printErrorMessage"?

done
Comment 5 jochen 2012-11-19 11:41:35 PST
Created attachment 175012 [details]
Patch for landing
Comment 6 jochen 2012-11-19 11:42:45 PST
Comment on attachment 175012 [details]
Patch for landing

Turns out that the css3/filters tests set a web preference we don't support, and so we actually depend on the correct format in logErrorToConsole aka printErrorMessage
Comment 7 WebKit Review Bot 2012-11-19 12:06:04 PST
Comment on attachment 175012 [details]
Patch for landing

Clearing flags on attachment: 175012

Committed r135184: <http://trac.webkit.org/changeset/135184>
Comment 8 WebKit Review Bot 2012-11-19 12:06:09 PST
All reviewed patches have been landed.  Closing bug.