Changeset 82892 in webkit


Ignore:
Timestamp:
Apr 4, 2011 4:31:00 PM (13 years ago)
Author:
tony@chromium.org
Message:

2011-04-04 Tony Chang <tony@chromium.org>

Reviewed by Ojan Vafai.

[chromium] don't write .checksum files if a fallback platform has an embedded checksum
https://bugs.webkit.org/show_bug.cgi?id=57783

  • Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
  • Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r82885 r82892  
     12011-04-04  Tony Chang  <tony@chromium.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        [chromium] don't write .checksum files if a fallback platform has an embedded checksum
     6        https://bugs.webkit.org/show_bug.cgi?id=57783
     7
     8        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
     9        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
     10
    1112011-04-04  Kevin Ollivier  <kevino@theolliviers.com>
    212
  • trunk/Tools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py

    r82816 r82892  
    392392                continue
    393393
    394             if suffix == '.checksum' and self._png_has_same_checksum(temp_name, expected_fullpath):
     394            if suffix == '.checksum' and self._png_has_same_checksum(temp_name, test, expected_fullpath):
     395                self._filesystem.remove(temp_name)
    395396                # If an old checksum exists, delete it.
    396397                self._delete_baseline(expected_fullpath)
     
    424425        return temp_name
    425426
    426     def _png_has_same_checksum(self, checksum_path, checksum_expected_fullpath):
    427         """Returns True if the png file next to |checksum_expected_fullpath|
     427    def _png_has_same_checksum(self, checksum_path, test, checksum_expected_fullpath):
     428        """Returns True if the fallback png for |checksum_expected_fullpath|
    428429        contains the same checksum."""
    429430        fs = self._filesystem
    430         png_fullpath = fs.splitext(checksum_expected_fullpath)[0] + '.png'
     431        png_fullpath = self._first_fallback_png_for_test(test)
     432
    431433        if not fs.exists(png_fullpath):
    432434            _log.error('  Checksum without png file found! Expected %s to exist.' % png_fullpath)
     
    442444            return checksum_in_text_file == checksum_in_png
    443445
     446    def _first_fallback_png_for_test(self, test):
     447        test_filepath = self._filesystem.join(self._target_port.layout_tests_dir(), test)
     448        all_baselines = self._rebaseline_port.expected_baselines(
     449            test_filepath, '.png', True)
     450        return self._filesystem.join(all_baselines[0][0], all_baselines[0][1])
     451
    444452    def _is_dup_baseline(self, new_baseline, baseline_path, test, suffix, platform):
    445453        """Check whether a baseline is duplicate and can fallback to same
     
    449457
    450458        Args:
    451           expected_filename: baseline expectation file name.
     459          new_baseline: temp filename containing the new baseline results
     460          baseline_path: baseline expectation file name.
    452461          test: test name.
    453462          suffix: file suffix of the expected results, including dot;
  • trunk/Tools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py

    r82705 r82892  
    289289        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
    290290
     291    def test_png_file_with_comment_as_duplicate(self):
     292        rebaseliner, filesystem = self.make_rebaseliner(
     293            "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
     294        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.png'] = 'tEXtchecksum\x000123456789'
     295        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.txt'] = 'png-comment-txt'
     296
     297        compile_success = rebaseliner._compile_rebaselining_tests()
     298        self.assertTrue(compile_success)
     299        self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests)
     300        rebaseliner.run()
     301        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png', None), None)
     302        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt', None), None)
     303        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
     304
    291305    def test_diff_baselines_txt(self):
    292306        rebaseliner, filesystem = self.make_rebaseliner("")
Note: See TracChangeset for help on using the changeset viewer.