示例#1
0
    def test_all_platforms(self):
        expectations = "BUGX REBASELINE : failures/expected/image.html = IMAGE"

        options = test_options()
        host_port_obj, filesystem = test_host_port_and_filesystem(options, expectations)
        url_fetcher = test_url_fetcher(filesystem)
        zip_factory = test_zip_factory()
        mock_scm = mocktool.MockSCM()
        filesystem.maybe_make_directory(mock_scm.checkout_root)

        # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently.
        filesystem.chdir("/test.checkout")

        oc = outputcapture.OutputCapture()
        oc.capture_output()
        res = rebaseline_chromium_webkit_tests.real_main(options, options,
            host_port_obj, host_port_obj, url_fetcher, zip_factory, mock_scm)
        oc.restore_output()

        # We expect to have written 38 files over the course of this rebaseline:
        # *) 6*3 files in /__im_tmp/ for the archived members of the 6 ports
        # *) 2*3 files in /test.checkout for actually differing baselines
        # *) 1 file in /test.checkout for the updated test_expectations file
        # *) 2*4 files in /tmp for the old/new baselines for the two actual ports
        # *) 2 files in /tmp for the text diffs for the two ports
        # *) 2 files in /tmp for the image diffs for the two ports
        # *) 1 file in /tmp for the rebaseline results html file
        self.assertEqual(res, 0)
        self.assertEqual(len(filesystem.written_files), 38)
    def test_all_platforms(self):
        expectations = "BUGX REBASELINE : failures/expected/image.html = IMAGE"

        options = test_options()
        host_port_obj, filesystem = test_host_port_and_filesystem(
            options, expectations)
        url_fetcher = test_url_fetcher(filesystem)
        zip_factory = test_zip_factory()
        mock_scm = mocktool.MockSCM()
        oc = outputcapture.OutputCapture()
        oc.capture_output()
        res = rebaseline_chromium_webkit_tests.real_main(
            options, options, host_port_obj, host_port_obj, url_fetcher,
            zip_factory, mock_scm)
        oc.restore_output()

        # We expect to have written 36 files over the course of this rebaseline:
        # *) 6*3 files in /__im_tmp/ for the archived members of the 6 ports
        # *) 2*3 files in /test.checkout for actually differing baselines
        # *) 1 file in /test.checkout for the updated test_expectations file
        # *) 2*4 files in /tmp for the old/new baselines for the two actual ports
        # *) 2 files in /tmp for the text diffs for the two ports
        # *) 1 file in /tmp for the rebaseline results html file
        self.assertEqual(res, 0)
        self.assertEqual(len(filesystem.written_files), 36)
    def test_all_platforms(self):
        expectations = "BUGX REBASELINE : failures/expected/image.html = IMAGE"

        options = test_options()

        host_port_obj, filesystem = test_host_port_and_filesystem(options, expectations)
        url_fetcher = test_url_fetcher(filesystem)
        zip_factory = test_zip_factory()
        mock_scm = mocktool.MockSCM()
        oc = outputcapture.OutputCapture()
        oc.capture_output()
        rebaseline_chromium_webkit_tests.real_main(options, options, host_port_obj,
            host_port_obj, url_fetcher, zip_factory, mock_scm)
        oc.restore_output()

        # We expect to have written 35 files over the course of this rebaseline:
        # *) 11 files * 3 ports for the new baselines and the diffs (see breakdown
        #    under test_one_platform, above)
        # *) the updated test_expectations file
        # *) the rebaseline results html file
        self.assertEqual(len(filesystem.written_files), 35)
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test/test_expectations.txt'], '')