Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1196)

Unified Diff: content/test/gpu/page_sets/gpu_process_tests.py

Issue 1874643003: Do not lose secondary gpus and make sure to have an active gpu on multiple gpu configurations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added use_testing_switches param to ParseSecondaryGpuDevicesFromCommandLine and added IdentifyActiv… Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/test/gpu/page_sets/gpu_process_tests.py
diff --git a/content/test/gpu/page_sets/gpu_process_tests.py b/content/test/gpu/page_sets/gpu_process_tests.py
index 04fd7cc43f1e5b31b12d91f8ebec0ca2ddc01fdb..ac4e9a737ff6b052ca1f8cf21ad84a781fa28cce 100644
--- a/content/test/gpu/page_sets/gpu_process_tests.py
+++ b/content/test/gpu/page_sets/gpu_process_tests.py
@@ -13,6 +13,8 @@ class GpuProcessSharedPageState(gpu_test_base.GpuSharedPageState):
'--gpu-testing-os-version',
'--gpu-testing-vendor-id',
'--gpu-testing-device-id',
+ '--gpu-testing-secondary-vendor-ids',
+ '--gpu-testing-secondary-device-ids',
'--gpu-testing-gl-vendor',
'--gpu-testing-gl-renderer',
'--gpu-testing-gl-version']
@@ -30,6 +32,42 @@ class GpuProcessSharedPageState(gpu_test_base.GpuSharedPageState):
old_gpu_switches.append(opt)
options.difference_update(old_gpu_switches)
+
+class IdentifyActiveGpuPageBase(gpu_test_base.PageBase):
+
+ def __init__(self, name=None, page_set=None, shared_page_state_class=None,
+ expectations=None, active_gpu=None, inactive_gpus=None):
+ super(IdentifyActiveGpuPageBase, self).__init__(
+ url='chrome:gpu',
+ name=name,
+ page_set=page_set,
+ shared_page_state_class=shared_page_state_class,
+ expectations=expectations)
+ self.active_gpu = active_gpu
+ self.inactive_gpus = inactive_gpus
+
+ def Validate(self, tab, results):
+ basic_infos = tab.EvaluateJavaScript('browserBridge.gpuInfo.basic_info')
+ active_gpu = []
+ inactive_gpus = []
+ index = 0
+ for info in basic_infos:
+ description = info['description']
+ value = info['value']
+ if description.startswith('GPU%d' % index) and value.startswith('VENDOR'):
+ if value.endswith('*ACTIVE*'):
+ active_gpu.append(value)
+ else:
+ inactive_gpus.append(value)
+ index += 1
+
+ if active_gpu != self.active_gpu:
+ raise page_test.Failure('Active GPU field is wrong %s' % active_gpu)
+
+ if inactive_gpus != self.inactive_gpus:
+ raise page_test.Failure('Inactive GPU field is wrong %s' % inactive_gpus)
+
+
class GpuProcessTestsPage(gpu_test_base.PageBase):
def __init__(self, url, name, story_set, expectations):
super(GpuProcessTestsPage, self).__init__(url=url,
@@ -205,6 +243,134 @@ class DriverBugWorkaroundsInGpuProcessPage(gpu_test_base.PageBase):
raise page_test.Failure('%s missing in GPU process workarounds: %s' \
% (workaround, gpu_list))
+
+class IdentifyActiveGpuSharedPageState1(GpuProcessSharedPageState):
+ def __init__(self, test, finder_options, story_set):
+ super(IdentifyActiveGpuSharedPageState1, self).__init__(
+ test, finder_options, story_set)
+ opts = finder_options.browser_options
+
+ if sys.platform in ('cygwin', 'win32') or sys.platform.startswith('linux'):
+ opts.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x8086')
+ opts.AppendExtraBrowserArgs('--gpu-testing-device-id=0x040a')
+ opts.AppendExtraBrowserArgs('--gpu-testing-secondary-vendor-ids=0x10de')
+ opts.AppendExtraBrowserArgs('--gpu-testing-secondary-device-ids=0x0de1')
+ opts.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=nouveau')
+
+
+class IdentifyActiveGpuPage1(IdentifyActiveGpuPageBase):
+ def __init__(self, story_set, expectations):
+ active_gpu = ['VENDOR = 0x10de, DEVICE= 0x0de1 *ACTIVE*']
+ inactive_gpus = ['VENDOR = 0x8086, DEVICE= 0x040a']
+
+ super(IdentifyActiveGpuPage1, self).__init__(
+ name='GpuProcess.identify_active_gpu1',
+ page_set=story_set,
+ shared_page_state_class=IdentifyActiveGpuSharedPageState1,
+ expectations=expectations,
+ active_gpu=active_gpu,
+ inactive_gpus=inactive_gpus)
+
+ def Validate(self, tab, results):
+ super(IdentifyActiveGpuPage1, self).Validate(tab, results)
+
+
+class IdentifyActiveGpuSharedPageState2(GpuProcessSharedPageState):
+ def __init__(self, test, finder_options, story_set):
+ super(IdentifyActiveGpuSharedPageState2, self).__init__(
+ test, finder_options, story_set)
+ opts = finder_options.browser_options
+
+ if sys.platform in ('cygwin', 'win32') or sys.platform.startswith('linux'):
+ opts.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x8086')
+ opts.AppendExtraBrowserArgs('--gpu-testing-device-id=0x040a')
+ opts.AppendExtraBrowserArgs('--gpu-testing-secondary-vendor-ids=0x10de')
+ opts.AppendExtraBrowserArgs('--gpu-testing-secondary-device-ids=0x0de1')
+ opts.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Intel')
+
+
+class IdentifyActiveGpuPage2(IdentifyActiveGpuPageBase):
+ def __init__(self, story_set, expectations):
+ active_gpu = ['VENDOR = 0x8086, DEVICE= 0x040a *ACTIVE*']
+ inactive_gpus = ['VENDOR = 0x10de, DEVICE= 0x0de1']
+
+ super(IdentifyActiveGpuPage2, self).__init__(
+ name='GpuProcess.identify_active_gpu2',
+ page_set=story_set,
+ shared_page_state_class=IdentifyActiveGpuSharedPageState2,
+ expectations=expectations,
+ active_gpu=active_gpu,
+ inactive_gpus=inactive_gpus)
+
+ def Validate(self, tab, results):
+ super(IdentifyActiveGpuPage2, self).Validate(tab, results)
+
+
+class IdentifyActiveGpuSharedPageState3(GpuProcessSharedPageState):
+ def __init__(self, test, finder_options, story_set):
+ super(IdentifyActiveGpuSharedPageState3, self).__init__(
+ test, finder_options, story_set)
+ opts = finder_options.browser_options
+
+ if sys.platform in ('cygwin', 'win32') or sys.platform.startswith('linux'):
+ opts.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x8086')
+ opts.AppendExtraBrowserArgs('--gpu-testing-device-id=0x040a')
+ opts.AppendExtraBrowserArgs('--gpu-testing-secondary-vendor-ids= \
+ 0x10de;0x1002')
+ opts.AppendExtraBrowserArgs('--gpu-testing-secondary-device-ids= \
+ 0x0de1;0x6779')
+ opts.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=X.Org')
+ opts.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=AMD R600')
+
+
+class IdentifyActiveGpuPage3(IdentifyActiveGpuPageBase):
+ def __init__(self, story_set, expectations):
+ active_gpu = ['VENDOR = 0x1002, DEVICE= 0x6779 *ACTIVE*']
+ inactive_gpus = ['VENDOR = 0x8086, DEVICE= 0x040a', \
+ 'VENDOR = 0x10de, DEVICE= 0x0de1']
+
+ super(IdentifyActiveGpuPage3, self).__init__(
+ name='GpuProcess.identify_active_gpu3',
+ page_set=story_set,
+ shared_page_state_class=IdentifyActiveGpuSharedPageState3,
+ expectations=expectations,
+ active_gpu=active_gpu,
+ inactive_gpus=inactive_gpus)
+
+ def Validate(self, tab, results):
+ super(IdentifyActiveGpuPage3, self).Validate(tab, results)
+
+
+class IdentifyActiveGpuSharedPageState4(GpuProcessSharedPageState):
+ def __init__(self, test, finder_options, story_set):
+ super(IdentifyActiveGpuSharedPageState4, self).__init__(
+ test, finder_options, story_set)
+ opts = finder_options.browser_options
+
+ if sys.platform in ('cygwin', 'win32') or sys.platform.startswith('linux'):
+ opts.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de')
+ opts.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1')
+ opts.AppendExtraBrowserArgs('--gpu-testing-secondary-vendor-ids=')
+ opts.AppendExtraBrowserArgs('--gpu-testing-secondary-device-ids=')
+ opts.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=nouveau')
+
+
+class IdentifyActiveGpuPage4(IdentifyActiveGpuPageBase):
+ def __init__(self, story_set, expectations):
+ active_gpu = ['VENDOR = 0x10de, DEVICE= 0x0de1 *ACTIVE*']
+ inactive_gpus = []
+
+ super(IdentifyActiveGpuPage4, self).__init__(
+ name='GpuProcess.identify_active_gpu4',
+ page_set=story_set,
+ shared_page_state_class=IdentifyActiveGpuSharedPageState4,
+ expectations=expectations,
+ active_gpu=active_gpu,
+ inactive_gpus=inactive_gpus)
+
+ def Validate(self, tab, results):
+ super(IdentifyActiveGpuPage4, self).Validate(tab, results)
+
class GpuProcessTestsStorySet(story_set_module.StorySet):
""" Tests that accelerated content triggers the creation of a GPU process """
@@ -231,6 +397,10 @@ class GpuProcessTestsStorySet(story_set_module.StorySet):
self.AddStory(SoftwareGpuProcessPage(self, expectations))
self.AddStory(SkipGpuProcessPage(self, expectations))
self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations))
+ self.AddStory(IdentifyActiveGpuPage1(self, expectations))
+ self.AddStory(IdentifyActiveGpuPage2(self, expectations))
+ self.AddStory(IdentifyActiveGpuPage3(self, expectations))
+ self.AddStory(IdentifyActiveGpuPage4(self, expectations))
@property
def allow_mixed_story_states(self):

Powered by Google App Engine
This is Rietveld 408576698