content/test/gpu/gpu_tests/trace_integration_test.py
def _EvaluateSuccess_CheckSwapChainPath(self, category, event_iterator,
                                          other_args):
    """Verifies that swap chains are used as expected for low latency canvas."""
    os_name = self.browser.platform.GetOSName()
    assert os_name and os_name.lower() == 'win'

    overlay_bot_config = self.GetOverlayBotConfig()
    if overlay_bot_config is None:
      self.fail('Overlay bot config can not be determined')
    assert overlay_bot_config.get('direct_composition', False)

    expect_no_overlay = other_args and other_args.get('no_overlay', False)
    expect_overlay = not expect_no_overlay
    found_overlay = False

    # Verify expectations through captured trace events.
    for event in event_iterator:
      if event.category != category:
        continue
      if event.name != _PRESENT_TO_SWAP_CHAIN_EVENT_NAME:
        continue
      image_type = event.args.get('image_type', None)
      if image_type == 'swap chain':
        found_overlay = True
        break
    if expect_overlay and not found_overlay:
      self.fail(
          'Overlay expected but not found: matching %s events were not found' %
          _PRESENT_TO_SWAP_CHAIN_EVENT_NAME)
    elif expect_no_overlay and found_overlay:
      self.fail(
          'Overlay not expected but found: matching %s events were found' %
          _PRESENT_TO_SWAP_CHAIN_EVENT_NAME)
Verifies that swap chains are used as expected for low latency canvas.
Verifies that swap chains are used as expected for low latency canvas.
Verifies that swap chains are used as expected for low latency canvas .
def _EvaluateSuccess_CheckSwapChainPath(self, category, event_iterator,
                                          other_args):
    os_name = self.browser.platform.GetOSName()
    assert os_name and os_name.lower() == 'win'
    overlay_bot_config = self.GetOverlayBotConfig()
    if overlay_bot_config is None:
      self.fail('Overlay bot config can not be determined')
    assert overlay_bot_config.get('direct_composition', False)
    expect_no_overlay = other_args and other_args.get('no_overlay', False)
    expect_overlay = not expect_no_overlay
    found_overlay = False
    for event in event_iterator:
      if event.category != category:
        continue
      if event.name != _PRESENT_TO_SWAP_CHAIN_EVENT_NAME:
        continue
      image_type = event.args.get('image_type', None)
      if image_type == 'swap chain':
        found_overlay = True
        break
    if expect_overlay and not found_overlay:
      self.fail(
          'Overlay expected but not found: matching %s events were not found' %
          _PRESENT_TO_SWAP_CHAIN_EVENT_NAME)
    elif expect_no_overlay and found_overlay:
      self.fail(
          'Overlay not expected but found: matching %s events were found' %
          _PRESENT_TO_SWAP_CHAIN_EVENT_NAME)
def _EvaluateSuccess_CheckSwapChainPath ( self , category , event_iterator , other_args ) : os_name = self . browser . platform . GetOSName ( ) assert os_name and os_name . lower ( ) == 'win' overlay_bot_config = self . GetOverlayBotConfig ( ) if overlay_bot_config is None : self . fail ( 'Overlay bot config can not be determined' ) assert overlay_bot_config . get ( 'direct_composition' , False ) expect_no_overlay = other_args and other_args . get ( 'no_overlay' , False ) expect_overlay = not expect_no_overlay found_overlay = False for event in event_iterator : if event . category != category : continue if event . name != _PRESENT_TO_SWAP_CHAIN_EVENT_NAME : continue image_type = event . args . get ( 'image_type' , None ) if image_type == 'swap chain' : found_overlay = True break if expect_overlay and not found_overlay : self . fail ( 'Overlay expected but not found: matching %s events were not found' % _PRESENT_TO_SWAP_CHAIN_EVENT_NAME ) elif expect_no_overlay and found_overlay : self . fail ( 'Overlay not expected but found: matching %s events were found' % _PRESENT_TO_SWAP_CHAIN_EVENT_NAME )
Verifies that swap chains are used as expected for low latency canvas.
Verifies that swap chains are used as expected for low latency canvas .
"""Verifies that swap chains are used as expected for low latency canvas.""" # Verify expectations through captured trace events.
self
category
event_iterator
other_args