Index: content/browser/gpu/gpu_data_manager_impl_private.cc |
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc |
index 0a07e936bf5bbc23c5cc6c6b4d860352593d1de8..65f90f142d52fbb76d21fb39415880fb99a205f6 100644 |
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc |
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc |
@@ -477,7 +477,11 @@ void GpuDataManagerImplPrivate::SetGLStrings(const std::string& gl_vendor, |
gpu_info.gl_version = gl_version; |
gpu::IdentifyActiveGPU(&gpu_info); |
- gpu::CollectDriverInfoGL(&gpu_info); |
+ |
+ // Give a chance to IsEssentialGpuInfoAvailable() to return true. Useful |
+ // to prevent launching the gpu process from SystemInfoHandler::GetInfo |
+ // from DevToolsHttpHandler when running python browser tests. |
+ gpu_info.context_info_state = gpu::CollectDriverInfoGL(&gpu_info); |
Zhenyao Mo
2016/02/01 20:25:39
Sorry that I didn't realize this in the first plac
|
UpdateGpuInfo(gpu_info); |
UpdateGpuSwitchingManager(gpu_info); |
@@ -523,6 +527,20 @@ void GpuDataManagerImplPrivate::Initialize() { |
TRACE_EVENT0("startup", |
"GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); |
gpu::CollectBasicGraphicsInfo(&gpu_info); |
+ |
+ if (command_line->HasSwitch(switches::kGpuTestingVendorId)) { |
Zhenyao Mo
2016/02/01 20:19:36
It should always be the case that we either specif
|
+ base::HexStringToUInt( |
+ command_line->GetSwitchValueASCII(switches::kGpuTestingVendorId), |
+ &gpu_info.gpu.vendor_id); |
+ gpu_info.gpu.active = true; |
+ } |
+ |
+ if (command_line->HasSwitch(switches::kGpuTestingDeviceId)) { |
+ base::HexStringToUInt( |
+ command_line->GetSwitchValueASCII(switches::kGpuTestingDeviceId), |
+ &gpu_info.gpu.device_id); |
+ gpu_info.gpu.active = true; |
+ } |
} |
#if defined(ARCH_CPU_X86_FAMILY) |
if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) { |
@@ -556,9 +574,17 @@ void GpuDataManagerImplPrivate::Initialize() { |
void GpuDataManagerImplPrivate::UpdateGpuInfoHelper() { |
GetContentClient()->SetGpuInfo(gpu_info_); |
+ const base::CommandLine* command_line = |
+ base::CommandLine::ForCurrentProcess(); |
+ |
+ std::string os_version; |
+ if (command_line->HasSwitch(switches::kGpuTestingOsVersion)) |
+ os_version = |
+ command_line->GetSwitchValueASCII(switches::kGpuTestingOsVersion); |
+ |
if (gpu_blacklist_) { |
std::set<int> features = gpu_blacklist_->MakeDecision( |
- gpu::GpuControlList::kOsAny, std::string(), gpu_info_); |
+ gpu::GpuControlList::kOsAny, os_version, gpu_info_); |
if (update_histograms_) |
UpdateStats(gpu_info_, gpu_blacklist_.get(), features); |
@@ -566,13 +592,11 @@ void GpuDataManagerImplPrivate::UpdateGpuInfoHelper() { |
} |
if (gpu_driver_bug_list_) { |
gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( |
- gpu::GpuControlList::kOsAny, std::string(), gpu_info_); |
+ gpu::GpuControlList::kOsAny, os_version, gpu_info_); |
std::set<std::string> disabled_ext_set; |
// Merge disabled extensions from the command line with gpu driver bug list. |
- const base::CommandLine* command_line = |
- base::CommandLine::ForCurrentProcess(); |
if (command_line) { |
const std::vector<std::string>& disabled_command_line_exts = |
base::SplitString( |