Exemplo n.º 1
0
    def testScreenshot(self):
        # Screenshots for Cluster Telemetry purposes currently only supported on
        # Linux platform.
        screenshot_test = screenshot.Screenshot(self.options.output_dir)
        self.RunPageTest(screenshot_test, 'file://screenshot_test.html')

        filepath = os.path.join(self.options.output_dir, 'screenshot_test.png')
        self.assertTrue(os.path.exists(filepath))
        self.assertTrue(os.path.isfile(filepath))
        self.assertTrue(os.access(filepath, os.R_OK))

        image = image_util.FromPngFile(filepath)
        screenshot_pixels = image_util.Pixels(image)
        special_colored_pixel = bytearray([217, 115, 43])
        self.assertTrue(special_colored_pixel in screenshot_pixels)
Exemplo n.º 2
0
    def testScreenshot(self):
        # Screenshots for Cluster Telemetry purposes currently only supported on
        # Linux platform.
        page_set = self.CreateStorySetFromFileInUnittestDataDir(
            'screenshot_test.html')
        measurement = screenshot.Screenshot(self._png_outdir)
        self.RunMeasurement(measurement, page_set, options=self._options)

        path = self._png_outdir + '/' + page_set.stories[
            0].file_safe_name + '.png'
        self.assertTrue(os.path.exists(path))
        self.assertTrue(os.path.isfile(path))
        self.assertTrue(os.access(path, os.R_OK))

        image = image_util.FromPngFile(path)
        screenshot_pixels = image_util.Pixels(image)
        special_colored_pixel = bytearray([217, 115, 43])
        self.assertTrue(special_colored_pixel in screenshot_pixels)
Exemplo n.º 3
0
 def CreatePageTest(self, options):
     return screenshot.Screenshot(options.png_outdir)
Exemplo n.º 4
0
 def CreatePageTest(self, options):
   return screenshot.Screenshot(options.png_outdir, options.wait_time,
     options.dc_detect, options.dc_wait_time, options.dc_extra_screenshots,
     options.dc_threshold)