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..61373e84b85a232d5c28a1583579fe9f7cff1155 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-id', |
+ '--gpu-testing-secondary-device-id', |
'--gpu-testing-gl-vendor', |
'--gpu-testing-gl-renderer', |
'--gpu-testing-gl-version'] |
@@ -205,6 +207,54 @@ class DriverBugWorkaroundsInGpuProcessPage(gpu_test_base.PageBase): |
raise page_test.Failure('%s missing in GPU process workarounds: %s' \ |
% (workaround, gpu_list)) |
+class IdentifyActiveGpuSharedPageState(GpuProcessSharedPageState): |
+ def __init__(self, test, finder_options, story_set): |
+ super(IdentifyActiveGpuSharedPageState, self).__init__( |
+ test, finder_options, story_set) |
+ options = finder_options.browser_options |
+ |
+ if sys.platform in ('cygwin', 'win32') or sys.platform.startswith('linux'): |
+ options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x1002') |
+ options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x6779') |
+ options.AppendExtraBrowserArgs('--gpu-testing-secondary-vendor-id=0x10de') |
+ options.AppendExtraBrowserArgs('--gpu-testing-secondary-device-id=0x0de1') |
Ken Russell (switch to Gerrit)
2016/04/14 01:54:59
A machine with both AMD and NVIDIA GPUs isn't a re
Julien Isorce Samsung
2016/04/14 18:02:47
Make sense I do not remember why I put AMD instead
|
+ options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=nouveau') |
+ |
+class IdentifyActiveGpuPage(gpu_test_base.PageBase): |
+ |
+ def __init__(self, story_set, expectations): |
+ super(IdentifyActiveGpuPage, self).__init__( |
+ url='chrome:gpu', |
+ name='GpuProcess.identify_active_gpu', |
+ page_set=story_set, |
+ shared_page_state_class=IdentifyActiveGpuSharedPageState, |
+ expectations=expectations) |
+ |
+ 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 |
+ |
+ print active_gpu, inactive_gpus |
+ |
+ if len(active_gpu) != 1 or \ |
+ active_gpu[0] != 'VENDOR = 0x10de, DEVICE= 0x0de1 *ACTIVE*': |
+ raise page_test.Failure('Active GPU field is wrong %s' % active_gpu) |
+ |
+ if len(inactive_gpus) != 1 or \ |
+ inactive_gpus[0] != 'VENDOR = 0x1002, DEVICE= 0x6779': |
+ raise page_test.Failure('Inactive GPU field is wrong %s' % inactive_gpus) |
+ |
class GpuProcessTestsStorySet(story_set_module.StorySet): |
""" Tests that accelerated content triggers the creation of a GPU process """ |
@@ -231,6 +281,7 @@ class GpuProcessTestsStorySet(story_set_module.StorySet): |
self.AddStory(SoftwareGpuProcessPage(self, expectations)) |
self.AddStory(SkipGpuProcessPage(self, expectations)) |
self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations)) |
+ self.AddStory(IdentifyActiveGpuPage(self, expectations)) |
@property |
def allow_mixed_story_states(self): |