コード例 #1
0
    def CreateStorySet(self, options):
        enable_memory_metric = self.enable_memory_metric

        def NavigateToPageAndLeavePage(self, action_runner):
            url = self.file_path_url_with_scheme if self.is_file else self.url
            action_runner.Navigate(url,
                                   self.script_to_evaluate_on_commit,
                                   timeout_in_seconds=_NAVIGATION_TIMEOUT)
            try:
                py_utils.WaitFor(action_runner.tab.HasReachedQuiescence,
                                 timeout=_QUIESCENCE_TIMEOUT)
            except py_utils.TimeoutException:
                pass

            # We measure memory after the wait as we want a proxy for page memory.
            if enable_memory_metric:
                action_runner.MeasureMemory(deterministic_mode=True)

            # Navigate away to an untracked page to trigger recording of page load
            # metrics
            action_runner.Navigate('about:blank',
                                   self.script_to_evaluate_on_commit,
                                   timeout_in_seconds=_NAVIGATION_TIMEOUT)

        return page_set.CTPageSet(
            options.urls_list,
            options.user_agent,
            options.archive_data_file,
            run_navigate_steps_callback=NavigateToPageAndLeavePage,
            cache_temperature=cache_temperature.COLD)
コード例 #2
0
ファイル: loading_ct.py プロジェクト: sokolovp/BraveMining
 def CreateStorySet(self, options):
   def Wait(action_runner):
     action_runner.Wait(options.wait_time)
   return page_set.CTPageSet(
     options.urls_list, options.user_agent, options.archive_data_file,
     traffic_setting=options.traffic_setting,
     run_page_interaction_callback=Wait)
コード例 #3
0
ファイル: memory_ct.py プロジェクト: Azile-Ttenneb/chromium-1
    def CreateStorySet(self, options):
        def WaitAndMeasureMemory(action_runner):
            action_runner.Wait(options.wait_time)
            action_runner.MeasureMemory(deterministic_mode=True)

        return page_set.CTPageSet(
            options.urls_list,
            options.user_agent,
            options.archive_data_file,
            traffic_setting=options.traffic_setting,
            run_page_interaction_callback=WaitAndMeasureMemory)
コード例 #4
0
ファイル: layout_shift.py プロジェクト: vermeerlee/chromium
    def CreateStorySet(self, options):
        def Wait(action_runner):
            action_runner.Wait(options.wait_time)

        def RunNavigateSteps(self, action_runner):
            action_runner.StartMobileDeviceEmulation(360, 640, 2)
            action_runner.Navigate(self.url)

        return page_set.CTPageSet(options.urls_list,
                                  options.user_agent,
                                  options.archive_data_file,
                                  traffic_setting=options.traffic_setting,
                                  cache_temperature=options.cache_temperature,
                                  run_page_interaction_callback=Wait,
                                  run_navigate_steps_callback=RunNavigateSteps)
コード例 #5
0
    def CreateStorySet(self, options):
        def RunNavigateSteps(self, action_runner):
            action_runner.Navigate('about:blank')
            action_runner.PrepareForLeakDetection()
            action_runner.MeasureMemory(True)
            action_runner.Navigate(self.url)
            py_utils.WaitFor(action_runner.tab.HasReachedQuiescence,
                             timeout=30)
            action_runner.Navigate('about:blank')
            action_runner.PrepareForLeakDetection()
            action_runner.MeasureMemory(True)

        return page_set.CTPageSet(options.urls_list,
                                  options.user_agent,
                                  options.archive_data_file,
                                  run_navigate_steps_callback=RunNavigateSteps)
コード例 #6
0
 def CreateStorySet(self, options):
   def RunNavigateSteps(self, action_runner):
       action_runner.Navigate('about:blank')
       action_runner.PrepareForLeakDetection()
       action_runner.MeasureMemory(True)
       action_runner.Navigate(self.url)
       try:
         py_utils.WaitFor(action_runner.tab.HasReachedQuiescence, timeout=30)
       except py_utils.TimeoutException:
         # Conduct leak detection whether or not loading has finished
         pass
       action_runner.Navigate('about:blank')
       action_runner.PrepareForLeakDetection()
       action_runner.MeasureMemory(True)
   return page_set.CTPageSet(
     options.urls_list, options.user_agent, options.archive_data_file,
     run_navigate_steps_callback=RunNavigateSteps)
コード例 #7
0
 def CreateStorySet(self, options):
     return page_set.CTPageSet(
         options.urls_list,
         options.user_agent,
         options.archive_data_file,
         run_page_interaction_callback=repaint_helpers.WaitThenRepaint)
コード例 #8
0
 def CreateStorySet(self, options):
     return ct_page_set.CTPageSet(options.urls_list, options.user_agent,
                                  options.archive_data_file)
コード例 #9
0
 def CreateStorySet(self, options):
     return page_set.CTPageSet(
         options.urls_list,
         options.user_agent,
         options.archive_data_file,
         run_page_interaction_callback=ScrollToEndOfPage)