Exemplo n.º 1
0
    def WillRunActions(self, page, tab):
        tab.WaitForDocumentReadyStateToBeComplete()
        self._smoothness_controller = smoothness_controller.SmoothnessController(
        )
        self._smoothness_controller.SetUp(page, tab)
        self._smoothness_controller.Start(tab)
        # Rasterize only what's visible.
        tab.ExecuteJavaScript(
            'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();')

        args = {}
        args['mode'] = self.options.mode
        if self.options.width:
            args['width'] = self.options.width
        if self.options.height:
            args['height'] = self.options.height

        # Enque benchmark
        tab.ExecuteJavaScript("""
        window.benchmark_results = {};
        window.benchmark_results.id =
            chrome.gpuBenchmarking.runMicroBenchmark(
                "invalidation_benchmark",
                function(value) {},
                """ + str(args) + """
            );
    """)

        self._micro_benchmark_id = tab.EvaluateJavaScript(
            'window.benchmark_results.id')
        if (not self._micro_benchmark_id):
            raise page_test.MeasurementFailure(
                'Failed to schedule invalidation_benchmark.')
Exemplo n.º 2
0
 def WillRunActions(self, page, tab):
   tab.WaitForDocumentReadyStateToBeComplete()
   self._smoothness_controller = smoothness_controller.SmoothnessController()
   self._smoothness_controller.Start(page, tab)
   # Rasterize only what's visible.
   tab.ExecuteJavaScript(
       'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();')
Exemplo n.º 3
0
 def WillRunActions(self, page, tab):
   self._power_metric = power.PowerMetric()
   self._power_metric.Start(page, tab)
   self._smoothness_controller = smoothness_controller.SmoothnessController()
   self._smoothness_controller.Start(page, tab)
Exemplo n.º 4
0
 def WillNavigateToPage(self, page, tab):
     self._power_metric.Start(page, tab)
     self._smoothness_controller = smoothness_controller.SmoothnessController(
     )
     self._smoothness_controller.SetUp(page, tab)