| Index: content/browser/gpu/gpu_data_manager_impl_private_unittest.cc
|
| diff --git a/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc b/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc
|
| index 880a83fe77f85d13a6bc49778cb7ce6e6645addc..c423ab953b73c3bba41790d39fc353f34704ed2f 100644
|
| --- a/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc
|
| +++ b/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc
|
| @@ -150,27 +150,17 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuSideBlacklisting) {
|
| EXPECT_TRUE(manager->GpuAccessAllowed(&reason));
|
| EXPECT_TRUE(reason.empty());
|
|
|
| - const std::string blacklist_json = LONG_STRING_CONST(
|
| - {
|
| - "name": "gpu blacklist",
|
| - "version": "0.1",
|
| - "entries": [
|
| - {
|
| - "id": 1,
|
| - "features": [
|
| - "webgl"
|
| - ]
|
| - },
|
| - {
|
| - "id": 2,
|
| - "gl_renderer": ".*GeForce.*",
|
| - "features": [
|
| - "accelerated_2d_canvas"
|
| - ]
|
| - }
|
| - ]
|
| + const std::string blacklist_json = LONG_STRING_CONST({
|
| + "name" : "gpu blacklist",
|
| + "version" : "0.1",
|
| + "entries" : [
|
| + {"id" : 1, "features" : ["accelerated_webgl"]}, {
|
| + "id" : 2,
|
| + "gl_renderer" : ".*GeForce.*",
|
| + "features" : ["accelerated_2d_canvas"]
|
| }
|
| - );
|
| + ]
|
| + });
|
|
|
| gpu::GPUInfo gpu_info;
|
| gpu_info.gpu.vendor_id = 0x10de;
|
| @@ -180,7 +170,8 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuSideBlacklisting) {
|
| EXPECT_TRUE(manager->GpuAccessAllowed(&reason));
|
| EXPECT_TRUE(reason.empty());
|
| EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
|
| - EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL));
|
| + EXPECT_TRUE(
|
| + manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL));
|
|
|
| gpu_info.gl_vendor = "NVIDIA";
|
| gpu_info.gl_renderer = "NVIDIA GeForce GT 120";
|
| @@ -188,7 +179,8 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuSideBlacklisting) {
|
| EXPECT_FALSE(manager->GpuAccessAllowed(&reason));
|
| EXPECT_FALSE(reason.empty());
|
| EXPECT_EQ(2u, manager->GetBlacklistedFeatureCount());
|
| - EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL));
|
| + EXPECT_TRUE(
|
| + manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL));
|
| EXPECT_TRUE(manager->IsFeatureBlacklisted(
|
| gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS));
|
| }
|
| @@ -204,28 +196,17 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuSideBlacklistingWebGL) {
|
| EXPECT_TRUE(manager->GpuAccessAllowed(&reason));
|
| EXPECT_TRUE(reason.empty());
|
|
|
| - const std::string blacklist_json = LONG_STRING_CONST(
|
| - {
|
| - "name": "gpu blacklist",
|
| - "version": "0.1",
|
| - "entries": [
|
| - {
|
| - "id": 1,
|
| - "features": [
|
| - "accelerated_2d_canvas"
|
| - ]
|
| - },
|
| - {
|
| - "id": 2,
|
| - "gl_renderer": ".*GeForce.*",
|
| - "features": [
|
| - "webgl",
|
| - "webgl2"
|
| - ]
|
| - }
|
| - ]
|
| + const std::string blacklist_json = LONG_STRING_CONST({
|
| + "name" : "gpu blacklist",
|
| + "version" : "0.1",
|
| + "entries" : [
|
| + {"id" : 1, "features" : ["accelerated_2d_canvas"]}, {
|
| + "id" : 2,
|
| + "gl_renderer" : ".*GeForce.*",
|
| + "features" : [ "accelerated_webgl", "webgl2" ]
|
| }
|
| - );
|
| + ]
|
| + });
|
|
|
| gpu::GPUInfo gpu_info;
|
| gpu_info.gpu.vendor_id = 0x10de;
|
| @@ -246,7 +227,8 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuSideBlacklistingWebGL) {
|
| EXPECT_EQ(3u, manager->GetBlacklistedFeatureCount());
|
| EXPECT_TRUE(manager->IsFeatureBlacklisted(
|
| gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS));
|
| - EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL));
|
| + EXPECT_TRUE(
|
| + manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL));
|
| EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2));
|
| }
|
|
|
| @@ -255,25 +237,15 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuSideExceptions) {
|
| EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
|
| EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
|
|
|
| - const std::string blacklist_json = LONG_STRING_CONST(
|
| - {
|
| - "name": "gpu blacklist",
|
| - "version": "0.1",
|
| - "entries": [
|
| - {
|
| - "id": 1,
|
| - "exceptions": [
|
| - {
|
| - "gl_renderer": ".*GeForce.*"
|
| - }
|
| - ],
|
| - "features": [
|
| - "webgl"
|
| - ]
|
| - }
|
| - ]
|
| - }
|
| - );
|
| + const std::string blacklist_json = LONG_STRING_CONST({
|
| + "name" : "gpu blacklist",
|
| + "version" : "0.1",
|
| + "entries" : [ {
|
| + "id" : 1,
|
| + "exceptions" : [ {"gl_renderer" : ".*GeForce.*"} ],
|
| + "features" : ["accelerated_webgl"]
|
| + } ]
|
| + });
|
| gpu::GPUInfo gpu_info;
|
| gpu_info.gpu.vendor_id = 0x10de;
|
| gpu_info.gpu.device_id = 0x0640;
|
| @@ -555,30 +527,19 @@ TEST_F(GpuDataManagerImplPrivateTest, SetGLStrings) {
|
| EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
|
| EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
|
|
|
| - const std::string blacklist_json = LONG_STRING_CONST(
|
| - {
|
| - "name": "gpu blacklist",
|
| - "version": "0.1",
|
| - "entries": [
|
| - {
|
| - "id": 1,
|
| - "vendor_id": "0x8086",
|
| - "exceptions": [
|
| - {
|
| - "device_id": ["0x0042"],
|
| - "driver_version": {
|
| - "op": ">=",
|
| - "value": "8.0.2"
|
| - }
|
| - }
|
| - ],
|
| - "features": [
|
| - "webgl"
|
| - ]
|
| - }
|
| - ]
|
| - }
|
| - );
|
| + const std::string blacklist_json = LONG_STRING_CONST({
|
| + "name" : "gpu blacklist",
|
| + "version" : "0.1",
|
| + "entries" : [ {
|
| + "id" : 1,
|
| + "vendor_id" : "0x8086",
|
| + "exceptions" : [ {
|
| + "device_id" : ["0x0042"],
|
| + "driver_version" : {"op" : ">=", "value" : "8.0.2"}
|
| + } ],
|
| + "features" : ["accelerated_webgl"]
|
| + } ]
|
| + });
|
| gpu::GPUInfo gpu_info;
|
| gpu_info.gpu.vendor_id = 0x8086;
|
| gpu_info.gpu.device_id = 0x0042;
|
| @@ -595,7 +556,8 @@ TEST_F(GpuDataManagerImplPrivateTest, SetGLStrings) {
|
| manager->SetGLStrings(kGLVendorMesa, kGLRendererMesa, kGLVersionMesa801);
|
| EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
|
| EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
|
| - EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL));
|
| + EXPECT_TRUE(
|
| + manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL));
|
| }
|
|
|
| TEST_F(GpuDataManagerImplPrivateTest, SetGLStringsNoEffects) {
|
| @@ -608,30 +570,19 @@ TEST_F(GpuDataManagerImplPrivateTest, SetGLStringsNoEffects) {
|
| EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
|
| EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
|
|
|
| - const std::string blacklist_json = LONG_STRING_CONST(
|
| - {
|
| - "name": "gpu blacklist",
|
| - "version": "0.1",
|
| - "entries": [
|
| - {
|
| - "id": 1,
|
| - "vendor_id": "0x8086",
|
| - "exceptions": [
|
| - {
|
| - "device_id": ["0x0042"],
|
| - "driver_version": {
|
| - "op": ">=",
|
| - "value": "8.0.2"
|
| - }
|
| - }
|
| - ],
|
| - "features": [
|
| - "webgl"
|
| - ]
|
| - }
|
| - ]
|
| - }
|
| - );
|
| + const std::string blacklist_json = LONG_STRING_CONST({
|
| + "name" : "gpu blacklist",
|
| + "version" : "0.1",
|
| + "entries" : [ {
|
| + "id" : 1,
|
| + "vendor_id" : "0x8086",
|
| + "exceptions" : [ {
|
| + "device_id" : ["0x0042"],
|
| + "driver_version" : {"op" : ">=", "value" : "8.0.2"}
|
| + } ],
|
| + "features" : ["accelerated_webgl"]
|
| + } ]
|
| + });
|
| gpu::GPUInfo gpu_info;
|
| gpu_info.gpu.vendor_id = 0x8086;
|
| gpu_info.gpu.device_id = 0x0042;
|
| @@ -645,7 +596,8 @@ TEST_F(GpuDataManagerImplPrivateTest, SetGLStringsNoEffects) {
|
| // Full GPUInfo, the entry applies.
|
| EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
|
| EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
|
| - EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL));
|
| + EXPECT_TRUE(
|
| + manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL));
|
|
|
| // Now assume browser gets GL strings from local state.
|
| // SetGLStrings() has no effects because GPUInfo already got these strings.
|
| @@ -653,7 +605,8 @@ TEST_F(GpuDataManagerImplPrivateTest, SetGLStringsNoEffects) {
|
| manager->SetGLStrings(kGLVendorMesa, kGLRendererMesa, kGLVersionMesa802);
|
| EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
|
| EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
|
| - EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL));
|
| + EXPECT_TRUE(
|
| + manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL));
|
| }
|
|
|
| TEST_F(GpuDataManagerImplPrivateTest, SetGLStringsDefered) {
|
| @@ -674,7 +627,7 @@ TEST_F(GpuDataManagerImplPrivateTest, SetGLStringsDefered) {
|
| "device_id" : ["0x0042"],
|
| "driver_vendor" : "Mesa",
|
| "driver_version" : {"op" : ">=", "value" : "8.0.0"},
|
| - "features" : ["webgl"]
|
| + "features" : ["accelerated_webgl"]
|
| } ]
|
| });
|
|
|
| @@ -690,7 +643,8 @@ TEST_F(GpuDataManagerImplPrivateTest, SetGLStringsDefered) {
|
|
|
| EXPECT_TRUE(manager->GpuAccessAllowed(NULL));
|
| EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
|
| - EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL));
|
| + EXPECT_TRUE(
|
| + manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL));
|
| }
|
| #endif // OS_LINUX
|
|
|
| @@ -764,22 +718,16 @@ TEST_F(GpuDataManagerImplPrivateTest, BlacklistAllFeatures) {
|
| TEST_F(GpuDataManagerImplPrivateTest, UpdateActiveGpu) {
|
| ScopedGpuDataManagerImpl manager;
|
|
|
| - const std::string blacklist_json = LONG_STRING_CONST(
|
| - {
|
| - "name": "gpu blacklist",
|
| - "version": "0.1",
|
| - "entries": [
|
| - {
|
| - "id": 1,
|
| - "vendor_id": "0x8086",
|
| - "multi_gpu_category": "active",
|
| - "features": [
|
| - "webgl"
|
| - ]
|
| - }
|
| - ]
|
| - }
|
| - );
|
| + const std::string blacklist_json = LONG_STRING_CONST({
|
| + "name" : "gpu blacklist",
|
| + "version" : "0.1",
|
| + "entries" : [ {
|
| + "id" : 1,
|
| + "vendor_id" : "0x8086",
|
| + "multi_gpu_category" : "active",
|
| + "features" : ["accelerated_webgl"]
|
| + } ]
|
| + });
|
|
|
| // Two GPUs, the secondary Intel GPU is active.
|
| gpu::GPUInfo gpu_info;
|
|
|