WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
27813
[Qt] DumpRenderTree lacks pixel tests support
https://bugs.webkit.org/show_bug.cgi?id=27813
Summary
[Qt] DumpRenderTree lacks pixel tests support
Ariya Hidayat
Reported
2009-07-29 13:19:18 PDT
DumpRenderTree of the Qt port currently does not support pixel tests. I will post a series of patches that implement this.
Attachments
Implement ImageDiff
(8.61 KB, patch)
2009-07-29 13:23 PDT
,
Ariya Hidayat
no flags
Details
Formatted Diff
Diff
Add pixel tests to DumpRenderTree
(6.80 KB, patch)
2009-07-29 13:27 PDT
,
Ariya Hidayat
no flags
Details
Formatted Diff
Diff
proposed fix
(2.62 KB, patch)
2010-02-03 07:33 PST
,
Csaba Osztrogonác
no flags
Details
Formatted Diff
Diff
proposed fix
(3.45 KB, patch)
2010-02-03 08:19 PST
,
Csaba Osztrogonác
no flags
Details
Formatted Diff
Diff
proposed fix
(3.43 KB, patch)
2010-02-03 11:17 PST
,
Csaba Osztrogonác
ariya.hidayat
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Ariya Hidayat
Comment 1
2009-07-29 13:23:40 PDT
Created
attachment 33737
[details]
Implement ImageDiff
Ariya Hidayat
Comment 2
2009-07-29 13:27:26 PDT
Created
attachment 33738
[details]
Add pixel tests to DumpRenderTree
Antonio Gomes
Comment 3
2009-07-29 13:46:25 PDT
<ariya> tonikitoo: relay to kenneth, give a try, check the coding style etc
Simon Hausmann
Comment 4
2009-07-30 05:16:11 PDT
Comment on
attachment 33737
[details]
Implement ImageDiff r=me. Cool stuff :)
Simon Hausmann
Comment 5
2009-07-30 05:18:15 PDT
Comment on
attachment 33738
[details]
Add pixel tests to DumpRenderTree r=me. One sidenote: Due to the WTF assertion macros not be consistenly exported in Mac framework builds in dbg vs. release it may be better to use Q_ASSERT instead of ASSERT() for now.
Ariya Hidayat
Comment 6
2009-07-30 06:11:54 PDT
Landed in
http://trac.webkit.org/changeset/46579
http://trac.webkit.org/changeset/46577
Csaba Osztrogonác
Comment 7
2010-02-03 07:32:33 PST
Now pixel tests don't work with QtWebKit because of defective DRT implementation. bug #1 run-webkit-tests pass filename with expected PNG hash to DRT. eg: test_path/test_name.html'3f973ccf15193923c3fa3fda3cccbb50 If the filename/URL doesn't start with "http:", "https:", "file:", DumpRenderTree::processLine test file existance incorrectly, because we should remove the hash code: QFileInfo fi(line); if (!fi.exists()) ... Now DumpRenderTree::open() separates the real filename and hash, we should move this mechanism to processLine to work correctly. bug #2 DumpRenderTree::dump() dumps only the first 32768 bytes chuck of PNG file. I have no idea what would you like to do with this code: if (written == block) break; I think it is absolutely unnecessary (and bad), so I propose to remove it.
Csaba Osztrogonác
Comment 8
2010-02-03 07:33:14 PST
Created
attachment 48028
[details]
proposed fix
Ariya Hidayat
Comment 9
2010-02-03 07:55:20 PST
Comment on
attachment 48028
[details]
proposed fix
> + [Qt] DumpRenderTree lacks pixel tests support > +
https://bugs.webkit.org/show_bug.cgi?id=27813
Maybe provide the description of your fix, rather then the bug?
> + m_expectedHash = QString(); > + if (m_dumpPixels) { > + // single quote marks the pixel dump hash > + int i = line.indexOf('\''); > + if (i > -1) { > + m_expectedHash = line.mid(i + 1, line.length()); > + line.remove(i, line.length()); > + } > + }
Looks good.
> - if (written == block) > - break;
This is because it is ported from other DRT. Maybe check why this exists elsewhere?
Csaba Osztrogonác
Comment 10
2010-02-03 08:18:51 PST
You ported this code from WebKitTools/DumpRenderTree/PixelDumpSupport.cpp: const size_t bytesToWriteInOneChunk = 1 << 15; size_t dataRemainingToWrite = dataLength; while (dataRemainingToWrite) { size_t bytesToWriteInThisChunk = std::min(dataRemainingToWrite, bytesToWriteInOneChunk); size_t bytesWritten = fwrite(data, 1, bytesToWriteInThisChunk, stdout); if (bytesWritten != bytesToWriteInThisChunk) break; dataRemainingToWrite -= bytesWritten; data += bytesWritten; } -- s/==/!=/ can solve the problem, but I think the original method and variable names are more understandable, so I suggest we should only port it without refactoring.
Csaba Osztrogonác
Comment 11
2010-02-03 08:19:30 PST
Created
attachment 48035
[details]
proposed fix
Csaba Osztrogonác
Comment 12
2010-02-03 11:17:36 PST
Created
attachment 48055
[details]
proposed fix
Ariya Hidayat
Comment 13
2010-02-03 11:33:12 PST
Comment on
attachment 48055
[details]
proposed fix LGTM.
Csaba Osztrogonác
Comment 14
2010-02-03 11:40:23 PST
Fix landed in
http://trac.webkit.org/changeset/54289
.
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