def testGenerateDisplayServer(self):
        platform = fakes.FakePlatform('mac', 'mojave')
        browser = fakes.FakeBrowser(platform, 'release')

        with mock.patch('sys.platform', 'darwin'):
            tags = gpu_integration_test.GpuIntegrationTest.GetPlatformTags(
                browser)
            for t in tags:
                self.assertFalse(t.startswith('display-server'))

        # Python 2's return value.
        with mock.patch('sys.platform', 'linux2'):
            tags = gpu_integration_test.GpuIntegrationTest.GetPlatformTags(
                browser)
            self.assertIn('display-server-x', tags)

            os.environ['WAYLAND_DISPLAY'] = 'wayland-0'
            tags = gpu_integration_test.GpuIntegrationTest.GetPlatformTags(
                browser)
            self.assertIn('display-server-wayland', tags)

        # Python 3's return value.
        with mock.patch('sys.platform', 'linux'):
            del os.environ['WAYLAND_DISPLAY']
            tags = gpu_integration_test.GpuIntegrationTest.GetPlatformTags(
                browser)
            self.assertIn('display-server-x', tags)

            os.environ['WAYLAND_DISPLAY'] = 'wayland-0'
            tags = gpu_integration_test.GpuIntegrationTest.GetPlatformTags(
                browser)
            self.assertIn('display-server-wayland', tags)
Esempio n. 2
0
def _GenerateNvidiaExampleTagsForTestClassAndArgs(test_class, args):
  with mock.patch.object(
      test_class, 'ExpectationsFiles', return_value=['exp.txt']):
    _ = [_ for _ in test_class.GenerateGpuTests(args)]
    platform = fakes.FakePlatform('win', 'win10')
    browser = fakes.FakeBrowser(platform, 'release')
    browser._returned_system_info = _GetSystemInfo(
        gpu=VENDOR_NVIDIA, device=0x1cb3, gl_renderer='ANGLE Direct3D9')
    return _GetTagsToTest(browser, test_class)
Esempio n. 3
0
 def testGenerateNvidiaExampleTags(self):
   platform = fakes.FakePlatform('win', 'win10')
   browser = fakes.FakeBrowser(platform, 'release')
   browser._returned_system_info = _GetSystemInfo(
       gpu=VENDOR_NVIDIA, device=0x1cb3, gl_renderer='ANGLE Direct3D9')
   self.assertEqual(
       _GetTagsToTest(browser),
       set(['win', 'win10', 'release', 'nvidia', 'nvidia-0x1cb3',
            'd3d9', 'no-passthrough']))
Esempio n. 4
0
 def testGenerateVendorTagUsingDeviceString(self):
   platform = fakes.FakePlatform('mac', 'mojave')
   browser = fakes.FakeBrowser(platform, 'release')
   browser._returned_system_info = _GetSystemInfo(
       vendor_string='illegal vendor string',
       device_string='ANGLE (Imagination, Triangle Monster 3000, 1.0)')
   self.assertEqual(
       _GetTagsToTest(browser),
       set(['mac', 'mojave', 'release', 'imagination',
            'imagination-Triangle-Monster-3000',
            'no-angle', 'no-passthrough']))
Esempio n. 5
0
 def testGenerateVendorTagUsingVendorString(self):
   platform = fakes.FakePlatform('mac', 'mojave')
   browser = fakes.FakeBrowser(platform, 'release')
   browser._returned_system_info = _GetSystemInfo(
       vendor_string=VENDOR_STRING_IMAGINATION,
       device_string=DEVICE_STRING_SGX,
       passthrough=True, gl_renderer='ANGLE OpenGL ES')
   self.assertEqual(
       _GetTagsToTest(browser),
       set(['mac', 'mojave', 'release', 'imagination',
            'imagination-PowerVR-SGX-554',
            'opengles', 'passthrough']))
Esempio n. 6
0
def _GenerateNvidiaExampleTagsForTestClassAndArgs(test_class, args):
    exp_files_fn = test_class.ExpectationsFiles
    ret = None
    try:
        test_class.ExpectationsFiles = mock.MagicMock(return_value=['exp.txt'])
        _ = [_ for _ in test_class.GenerateGpuTests(args)]
        platform = fakes.FakePlatform('win', 'win10')
        browser = fakes.FakeBrowser(platform, 'release')
        browser._returned_system_info = _GetSystemInfo(
            gpu=VENDOR_NVIDIA, device=0x1cb3, gl_renderer='ANGLE Direct3D9')
        ret = _GetTagsToTest(browser, test_class)
    finally:
        test_class.ExpectationsFiles = exp_files_fn
    return ret
Esempio n. 7
0
 def GenerateTags(cls, possible_browser, finder_options):
     # TODO(crbug.com/992260) Delete this after crrev.com/c/1769732 is merged.
     # We should keep this for now so that a browser instance is not spawned
     del possible_browser, finder_options
     return cls.GetPlatformTags(
         fakes.FakeBrowser(fakes.FakeLinuxPlatform, 'debug'))