Title: [118882] trunk/Websites/bugs.webkit.org
- Revision
- 118882
- Author
- [email protected]
- Date
- 2012-05-29 19:18:08 -0700 (Tue, 29 May 2012)
Log Message
Show an error in the pretty diff when an image lacks a checksum
https://bugs.webkit.org/show_bug.cgi?id=87791
Reviewed by Dirk Pranke.
* PrettyPatch/PrettyPatch.rb:
* PrettyPatch/PrettyPatch_test.rb:
Modified Paths
Diff
Modified: trunk/Websites/bugs.webkit.org/ChangeLog (118881 => 118882)
--- trunk/Websites/bugs.webkit.org/ChangeLog 2012-05-30 02:13:30 UTC (rev 118881)
+++ trunk/Websites/bugs.webkit.org/ChangeLog 2012-05-30 02:18:08 UTC (rev 118882)
@@ -1,3 +1,13 @@
+2012-05-29 Ojan Vafai <[email protected]>
+
+ Show an error in the pretty diff when an image lacks a checksum
+ https://bugs.webkit.org/show_bug.cgi?id=87791
+
+ Reviewed by Dirk Pranke.
+
+ * PrettyPatch/PrettyPatch.rb:
+ * PrettyPatch/PrettyPatch_test.rb:
+
2012-04-01 Adam Barth <[email protected]>
Code review tool no longer needs to work around position:fixed handling on iPad
Modified: trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb (118881 => 118882)
--- trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb 2012-05-30 02:13:30 UTC (rev 118881)
+++ trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb 2012-05-30 02:18:08 UTC (rev 118882)
@@ -98,6 +98,8 @@
Websites
]
+ IMAGE_CHECKSUM_ERROR = "<p>INVALID: Image lacks a checksum. This will fail with a MISSING error in run-webkit-tests. Always generate new png files using run-webkit-tests.</p>"
+
def self.normalize_line_ending(s)
s.gsub /\r\n?/, "\n"
end
@@ -578,7 +580,7 @@
end
image_snippet = "<img class='image' src='' />"
if not @image_checksum then
- return image_snippet
+ return IMAGE_CHECKSUM_ERROR + image_snippet
end
return "<p>" + @image_checksum + "</p>" + image_snippet
end
@@ -601,6 +603,8 @@
if image_checksum
str += image_checksum + "<br>"
+ else
+ str += IMAGE_CHECKSUM_ERROR + "<br>"
end
if image_url
str += "<img class='image' src='' />"
Modified: trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch_test.rb (118881 => 118882)
--- trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch_test.rb 2012-05-30 02:13:30 UTC (rev 118881)
+++ trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch_test.rb 2012-05-30 02:18:08 UTC (rev 118882)
@@ -60,9 +60,21 @@
assert_equal(info[Info::SHARED], $last_prettify_part_count["shared"], "Wrong number of 'shared' parts in " + description)
assert_equal(0, $last_prettify_part_count["binary"], "Wrong number of 'binary' parts in " + description)
assert_equal(0, $last_prettify_part_count["extract-error"], "Wrong number of 'extract-error' parts in " + description)
+ return pretty
end
def test_patches
PATCHES.each { |id, info| check_one_patch(id, info) }
end
+
+ def test_images_without_checksum
+ pretty = check_one_patch(144064, ["Images without checksums", 10, 5, 4, 8])
+ puts pretty
+ matches = pretty.match("INVALID: Image lacks a checksum.")
+ assert(matches, "Should have invalid checksums")
+ # FIXME: This should only have 4 invalid images, but git apply needs an actual copy of the before binary
+ # in order to apply diffs correctly. The end result is that all images in the patch are empty and thus
+ # thought to have no checksum, instead of the 4 images that actually don't have a checksum.
+ assert_equal(10, pretty.scan(/INVALID\: Image lacks a checksum\./).size)
+ end
end
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes