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

Unified Diff: gpu/config/gpu_info_collector_unittest.cc

Issue 2153373002: On Linux rework driver_version/vendor extraction from gl version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebase Created 4 years, 4 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
« no previous file with comments | « gpu/config/gpu_info_collector_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_info_collector_unittest.cc
diff --git a/gpu/config/gpu_info_collector_unittest.cc b/gpu/config/gpu_info_collector_unittest.cc
index c0847196508684874cf9aa790986c280e6a8645c..8c59574c6c97d6b02a28dd5cdc19323b3a25b6bc 100644
--- a/gpu/config/gpu_info_collector_unittest.cc
+++ b/gpu/config/gpu_info_collector_unittest.cc
@@ -246,64 +246,135 @@ class CollectDriverInfoGLTest : public testing::Test {
};
TEST_F(CollectDriverInfoGLTest, CollectDriverInfoGL) {
+ // clang-format off
const struct {
+ const char* driver_vendor;
+ const char* driver_version;
const char* gl_renderer;
const char* gl_vendor;
const char* gl_version;
+ const char* expected_driver_vendor;
const char* expected_driver_version;
} kTestStrings[] = {
#if defined(OS_ANDROID)
- {"Adreno (TM) 320",
+ {"Unknown",
+ "-1",
+ "Adreno (TM) 320",
"Qualcomm",
"OpenGL ES 2.0 V@14.0 AU@04.02 (CL@3206)",
+ "Unknown",
"14.0"},
- {"Adreno (TM) 420", "Qualcomm", "OpenGL ES 3.0 V@84.0 AU@ (CL@)", "84.0"},
- {"PowerVR Rogue G6430",
+ {"Unknown",
+ "-1",
+ "Adreno (TM) 420",
+ "Qualcomm",
+ "OpenGL ES 3.0 V@84.0 AU@ (CL@)",
+ "Unknown",
+ "84.0"},
+ {"Unknown",
+ "-1",
+ "PowerVR Rogue G6430",
"Imagination Technologies",
"OpenGL ES 3.1 build 1.4@3283119",
+ "Unknown",
"1.4"},
- {"Mali-T604", "ARM", "OpenGL ES 3.1", "0"},
- {"NVIDIA Tegra",
+ {"Unknown",
+ "-1",
+ "Mali-T604",
+ "ARM",
+ "OpenGL ES 3.1",
+ "Unknown",
+ "0"},
+ {"Unknown",
+ "-1",
+ "NVIDIA Tegra",
"NVIDIA Corporation",
"OpenGL ES 3.1 NVIDIA 343.00",
+ "Unknown",
"343.00"},
- {"NVIDIA Tegra 3",
+ {"Unknown",
+ "-1",
+ "NVIDIA Tegra 3",
"NVIDIA Corporation",
"OpenGL ES 2.0 14.01003",
+ "Unknown",
"14.01003"},
- {"random GPU",
+ {"Unknown",
+ "-1",
+ "random GPU",
"random vendor",
"OpenGL ES 2.0 with_long_version_string=1.2.3.4",
+ NULL,
"1.2"},
- {"random GPU",
+ {"Unknown",
+ "-1",
+ "random GPU",
"random vendor",
"OpenGL ES 2.0 with_short_version_string=1",
+ NULL,
"0"},
- {"random GPU",
+ {"Unknown",
+ "-1",
+ "random GPU",
"random vendor",
"OpenGL ES 2.0 with_no_version_string",
+ NULL,
"0"},
#elif defined(OS_MACOSX)
- {"Intel Iris Pro OpenGL Engine",
+ {"Unknown",
+ "-1",
+ "Intel Iris Pro OpenGL Engine",
"Intel Inc.",
"2.1 INTEL-10.6.20",
+ "Unknown",
"10.6.20"},
#elif defined(OS_LINUX)
- {"Quadro K2000/PCIe/SSE2",
+ {"",
+ "",
+ "Quadro K2000/PCIe/SSE2",
"NVIDIA Corporation",
"4.4.0 NVIDIA 331.79",
+ "NVIDIA",
"331.79"},
+ {"",
+ "",
+ "Gallium 0.4 on NVE7",
+ "nouveau",
+ "3.3 (Core Profile) Mesa 10.5.9",
+ "Mesa",
+ "10.5.9"},
+ {"",
+ "",
+ "Mesa DRI Intel(R) Haswell Mobile",
+ "Intel Open Source Technology Center",
+ "OpenGL ES 3.0 Mesa 12.1.0-devel (git-ed9dd3b)",
+ "Mesa",
+ "12.1.0"},
+ {"ATI / AMD",
+ "15.201.1151",
+ "ASUS R5 230 Series",
+ "ATI Technologies Inc.",
+ "4.5.13399 Compatibility Profile Context 14.0",
+ "ATI / AMD",
+ "15.201.1151"},
#endif
- {NULL, NULL, NULL, NULL}
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL}
};
+ // clang-format on
- GPUInfo gpu_info;
for (int i = 0; kTestStrings[i].gl_renderer != NULL; ++i) {
- gpu_info.gl_renderer = kTestStrings[i].gl_renderer;
- gpu_info.gl_vendor = kTestStrings[i].gl_vendor;
- gpu_info.gl_version = kTestStrings[i].gl_version;
- EXPECT_EQ(CollectDriverInfoGL(&gpu_info), kCollectInfoSuccess);
- EXPECT_EQ(gpu_info.driver_version, kTestStrings[i].expected_driver_version);
+ GPUInfo gpu_info;
+ const auto& testStrings = kTestStrings[i];
+ gpu_info.driver_vendor = testStrings.driver_vendor;
+ gpu_info.driver_version = testStrings.driver_version;
+ gpu_info.gl_renderer = testStrings.gl_renderer;
+ gpu_info.gl_vendor = testStrings.gl_vendor;
+ gpu_info.gl_version = testStrings.gl_version;
+ EXPECT_EQ(kCollectInfoSuccess, CollectDriverInfoGL(&gpu_info));
+ EXPECT_EQ(testStrings.expected_driver_version, gpu_info.driver_version);
+ if (testStrings.expected_driver_vendor) {
+ EXPECT_EQ(testStrings.expected_driver_vendor, gpu_info.driver_vendor);
+ }
}
}
« no previous file with comments | « gpu/config/gpu_info_collector_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698