OLD | NEW |
1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging | 5 import logging |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 from gpu_tests import gpu_integration_test | 9 from gpu_tests import gpu_integration_test |
10 from gpu_tests import gpu_process_expectations | 10 from gpu_tests import gpu_process_expectations |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 self._NavigateAndWait(test_path) | 462 self._NavigateAndWait(test_path) |
463 if self.tab.EvaluateJavaScript('chrome.gpuBenchmarking.hasGpuProcess()'): | 463 if self.tab.EvaluateJavaScript('chrome.gpuBenchmarking.hasGpuProcess()'): |
464 self.fail('GPU process detected') | 464 self.fail('GPU process detected') |
465 | 465 |
466 def _GpuProcess_identify_active_gpu1(self, test_path): | 466 def _GpuProcess_identify_active_gpu1(self, test_path): |
467 self.RestartBrowserIfNecessaryWithArgs([ | 467 self.RestartBrowserIfNecessaryWithArgs([ |
468 '--gpu-testing-vendor-id=0x8086', | 468 '--gpu-testing-vendor-id=0x8086', |
469 '--gpu-testing-device-id=0x040a', | 469 '--gpu-testing-device-id=0x040a', |
470 '--gpu-testing-secondary-vendor-ids=0x10de', | 470 '--gpu-testing-secondary-vendor-ids=0x10de', |
471 '--gpu-testing-secondary-device-ids=0x0de1', | 471 '--gpu-testing-secondary-device-ids=0x0de1', |
472 '--gpu-testing-gl-vendor=nouveau']) | 472 '--gpu-testing-gl-vendor=nouveau', |
| 473 '--disable-software-rasterizer']) |
473 self._Navigate(test_path) | 474 self._Navigate(test_path) |
474 self._VerifyActiveAndInactiveGPUs( | 475 self._VerifyActiveAndInactiveGPUs( |
475 ['VENDOR = 0x10de, DEVICE= 0x0de1 *ACTIVE*'], | 476 ['VENDOR = 0x10de, DEVICE= 0x0de1 *ACTIVE*'], |
476 ['VENDOR = 0x8086, DEVICE= 0x040a']) | 477 ['VENDOR = 0x8086, DEVICE= 0x040a']) |
477 | 478 |
478 def _GpuProcess_identify_active_gpu2(self, test_path): | 479 def _GpuProcess_identify_active_gpu2(self, test_path): |
479 self.RestartBrowserIfNecessaryWithArgs([ | 480 self.RestartBrowserIfNecessaryWithArgs([ |
480 '--gpu-testing-vendor-id=0x8086', | 481 '--gpu-testing-vendor-id=0x8086', |
481 '--gpu-testing-device-id=0x040a', | 482 '--gpu-testing-device-id=0x040a', |
482 '--gpu-testing-secondary-vendor-ids=0x10de', | 483 '--gpu-testing-secondary-vendor-ids=0x10de', |
483 '--gpu-testing-secondary-device-ids=0x0de1', | 484 '--gpu-testing-secondary-device-ids=0x0de1', |
484 '--gpu-testing-gl-vendor=Intel']) | 485 '--gpu-testing-gl-vendor=Intel', |
| 486 '--disable-software-rasterizer']) |
485 self._Navigate(test_path) | 487 self._Navigate(test_path) |
486 self._VerifyActiveAndInactiveGPUs( | 488 self._VerifyActiveAndInactiveGPUs( |
487 ['VENDOR = 0x8086, DEVICE= 0x040a *ACTIVE*'], | 489 ['VENDOR = 0x8086, DEVICE= 0x040a *ACTIVE*'], |
488 ['VENDOR = 0x10de, DEVICE= 0x0de1']) | 490 ['VENDOR = 0x10de, DEVICE= 0x0de1']) |
489 | 491 |
490 def _GpuProcess_identify_active_gpu3(self, test_path): | 492 def _GpuProcess_identify_active_gpu3(self, test_path): |
491 self.RestartBrowserIfNecessaryWithArgs([ | 493 self.RestartBrowserIfNecessaryWithArgs([ |
492 '--gpu-testing-vendor-id=0x8086', | 494 '--gpu-testing-vendor-id=0x8086', |
493 '--gpu-testing-device-id=0x040a', | 495 '--gpu-testing-device-id=0x040a', |
494 '--gpu-testing-secondary-vendor-ids=0x10de;0x1002', | 496 '--gpu-testing-secondary-vendor-ids=0x10de;0x1002', |
495 '--gpu-testing-secondary-device-ids=0x0de1;0x6779', | 497 '--gpu-testing-secondary-device-ids=0x0de1;0x6779', |
496 '--gpu-testing-gl-vendor=X.Org', | 498 '--gpu-testing-gl-vendor=X.Org', |
497 '--gpu-testing-gl-renderer=AMD R600']) | 499 '--gpu-testing-gl-renderer=AMD R600', |
| 500 '--disable-software-rasterizer']) |
498 self._Navigate(test_path) | 501 self._Navigate(test_path) |
499 self._VerifyActiveAndInactiveGPUs( | 502 self._VerifyActiveAndInactiveGPUs( |
500 ['VENDOR = 0x1002, DEVICE= 0x6779 *ACTIVE*'], | 503 ['VENDOR = 0x1002, DEVICE= 0x6779 *ACTIVE*'], |
501 ['VENDOR = 0x8086, DEVICE= 0x040a', | 504 ['VENDOR = 0x8086, DEVICE= 0x040a', |
502 'VENDOR = 0x10de, DEVICE= 0x0de1']) | 505 'VENDOR = 0x10de, DEVICE= 0x0de1']) |
503 | 506 |
504 def _GpuProcess_identify_active_gpu4(self, test_path): | 507 def _GpuProcess_identify_active_gpu4(self, test_path): |
505 self.RestartBrowserIfNecessaryWithArgs([ | 508 self.RestartBrowserIfNecessaryWithArgs([ |
506 '--gpu-testing-vendor-id=0x10de', | 509 '--gpu-testing-vendor-id=0x10de', |
507 '--gpu-testing-device-id=0x0de1', | 510 '--gpu-testing-device-id=0x0de1', |
508 '--gpu-testing-secondary-vendor-ids=', | 511 '--gpu-testing-secondary-vendor-ids=', |
509 '--gpu-testing-secondary-device-ids=', | 512 '--gpu-testing-secondary-device-ids=', |
510 '--gpu-testing-gl-vendor=nouveau']) | 513 '--gpu-testing-gl-vendor=nouveau', |
| 514 '--disable-software-rasterizer']) |
511 self._Navigate(test_path) | 515 self._Navigate(test_path) |
512 self._VerifyActiveAndInactiveGPUs( | 516 self._VerifyActiveAndInactiveGPUs( |
513 ['VENDOR = 0x10de, DEVICE= 0x0de1 *ACTIVE*'], | 517 ['VENDOR = 0x10de, DEVICE= 0x0de1 *ACTIVE*'], |
514 []) | 518 []) |
515 | 519 |
516 def _GpuProcess_disabling_workarounds_works(self, test_path): | 520 def _GpuProcess_disabling_workarounds_works(self, test_path): |
517 # Hit exception from id 215 from kGpuDriverBugListJson. | 521 # Hit exception from id 215 from kGpuDriverBugListJson. |
518 self.RestartBrowserIfNecessaryWithArgs([ | 522 self.RestartBrowserIfNecessaryWithArgs([ |
519 '--gpu-testing-vendor-id=0xbad9', | 523 '--gpu-testing-vendor-id=0xbad9', |
520 '--gpu-testing-device-id=0xbad9', | 524 '--gpu-testing-device-id=0xbad9', |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 gpu = self.browser.GetSystemInfo().gpu | 558 gpu = self.browser.GetSystemInfo().gpu |
555 if not gpu: | 559 if not gpu: |
556 self.fail('Target machine must have a GPU') | 560 self.fail('Target machine must have a GPU') |
557 if not gpu.aux_attributes: | 561 if not gpu.aux_attributes: |
558 self.fail('Browser must support GPU aux attributes') | 562 self.fail('Browser must support GPU aux attributes') |
559 if not gpu.aux_attributes['software_rendering']: | 563 if not gpu.aux_attributes['software_rendering']: |
560 self.fail("Software rendering was disabled") | 564 self.fail("Software rendering was disabled") |
561 device = gpu.devices[0] | 565 device = gpu.devices[0] |
562 if not device: | 566 if not device: |
563 self.fail("System Info doesn't have a device") | 567 self.fail("System Info doesn't have a device") |
564 if device.vendor_id != 0: | |
565 self.fail("Wrong vendor ID. Expected 0, got " + hex(device.vendor_id)) | |
566 if device.device_id != 0: | |
567 self.fail("Wrong device ID. Expected 0, got " + hex(device.device_id)) | |
568 | 568 |
569 def load_tests(loader, tests, pattern): | 569 def load_tests(loader, tests, pattern): |
570 del loader, tests, pattern # Unused. | 570 del loader, tests, pattern # Unused. |
571 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) | 571 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) |
OLD | NEW |