Exemplo n.º 1
0
 def __init__(self,
              url,
              name,
              test_rect,
              tolerance=2,
              browser_args=None,
              expected_colors=None,
              gpu_process_disabled=False,
              optional_action=None,
              restart_browser_after_test=False,
              other_args=None,
              grace_period_end=None,
              expected_per_process_crashes=None,
              matching_algorithm=None):
     super(PixelTestPage, self).__init__()
     self.url = url
     self.name = name
     self.test_rect = test_rect
     # The tolerance when comparing against the reference image.
     self.tolerance = tolerance
     self.browser_args = browser_args
     # The expected colors can be specified as a list of dictionaries,
     # in which case these specific pixels will be sampled instead of
     # comparing the entire image snapshot. The format is only defined
     # by contract with _CompareScreenshotSamples in
     # cloud_storage_integration_test_base.py.
     self.expected_colors = expected_colors
     # Only a couple of tests run with the GPU process completely
     # disabled. To prevent regressions, only allow the GPU information
     # to be incomplete in these cases.
     self.gpu_process_disabled = gpu_process_disabled
     # Some of the tests require custom actions to be run. These are
     # specified as a string which is the name of a method to call in
     # PixelIntegrationTest. For example if the action here is
     # "CrashGpuProcess" then it would be defined in a
     # "_CrashGpuProcess" method in PixelIntegrationTest.
     self.optional_action = optional_action
     # Whether the browser should be forcibly restarted after the test
     # runs. The browser is always restarted after running tests with
     # optional_actions.
     self.restart_browser_after_test = restart_browser_after_test
     # These are used to pass additional arguments to the test harness.
     # VideoPathTraceTest and OverlayModeTest support the following boolean
     # arguments: expect_yuy2, zero_copy, video_is_rotated, and no_overlay.
     self.other_args = other_args
     # This allows a newly added test to be exempted from failures for a
     # (hopefully) short period after being added. This is so that any slightly
     # different but valid images that get produced by the waterfall bots can
     # be triaged without turning the bots red.
     # This should be a datetime.date object.
     self.grace_period_end = grace_period_end
     # This lets the test runner know that one or more crashes are expected as
     # part of the test. Should be a map of process type (str) to expected number
     # of crashes (int).
     self.expected_per_process_crashes = expected_per_process_crashes or {}
     # This should be a child of
     # skia_gold_matching_algorithms.SkiaGoldMatchingAlgorithm. This specifies
     # which matching algorithm Skia Gold should use for the test.
     self.matching_algorithm = (matching_algorithm
                                or algo.ExactMatchingAlgorithm())
 def testGetCmdline(self):
     a = algo.ExactMatchingAlgorithm()
     self.assertEqual(a.GetCmdline(), [])