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

Unified Diff: gpu/config/gpu_info_collector_unittest.cc

Issue 2198923002: gpu/config Add unittests for driver vendor collection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gpu/config Add unittests for driver vendor collection Created 4 years, 5 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 | « no previous file | 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 af441cf124c2449dd00d7419cad6fb76d379aceb..0ae5477cf77ec2489a6e8bea7225effb37ba64b6 100644
--- a/gpu/config/gpu_info_collector_unittest.cc
+++ b/gpu/config/gpu_info_collector_unittest.cc
@@ -246,72 +246,103 @@ class CollectDriverInfoGLTest : public testing::Test {
};
TEST_F(CollectDriverInfoGLTest, CollectDriverInfoGL) {
+ // clang-format off
const struct {
const char* gl_renderer;
const char* gl_vendor;
const char* gl_version;
const char* expected_driver_version;
+ const char* expected_driver_vendor;
} kTestStrings[] = {
#if defined(OS_ANDROID)
{"Adreno (TM) 320",
"Qualcomm",
"OpenGL ES 2.0 V@14.0 AU@04.02 (CL@3206)",
- "14.0"},
- {"Adreno (TM) 420", "Qualcomm", "OpenGL ES 3.0 V@84.0 AU@ (CL@)", "84.0"},
+ "14.0",
+ ""},
+ {"Adreno (TM) 420",
+ "Qualcomm",
+ "OpenGL ES 3.0 V@84.0 AU@ (CL@)",
+ "84.0",
+ ""},
{"PowerVR Rogue G6430",
"Imagination Technologies",
"OpenGL ES 3.1 build 1.4@3283119",
- "1.4"},
- {"Mali-T604", "ARM", "OpenGL ES 3.1", "0"},
+ "1.4",
+ ""},
+ {"Mali-T604",
+ "ARM",
+ "OpenGL ES 3.1",
+ "0",
+ ""},
{"NVIDIA Tegra",
"NVIDIA Corporation",
"OpenGL ES 3.1 NVIDIA 343.00",
- "343.00"},
+ "343.00",
+ ""},
{"NVIDIA Tegra 3",
"NVIDIA Corporation",
"OpenGL ES 2.0 14.01003",
- "14.01003"},
+ "14.01003",
+ ""},
{"random GPU",
"random vendor",
"OpenGL ES 2.0 with_long_version_string=1.2.3.4",
- "1.2"},
+ "1.2",
+ NULL},
{"random GPU",
"random vendor",
"OpenGL ES 2.0 with_short_version_string=1",
- "0"},
+ "0",
+ NULL},
{"random GPU",
"random vendor",
"OpenGL ES 2.0 with_no_version_string",
- "0"},
+ "0",
+ NULL},
#elif defined(OS_MACOSX)
{"Intel Iris Pro OpenGL Engine",
"Intel Inc.",
"2.1 INTEL-10.6.20",
- "10.6.20"},
+ "10.6.20",
+ ""},
#elif defined(OS_LINUX)
{"Quadro K2000/PCIe/SSE2",
"NVIDIA Corporation",
"4.4.0 NVIDIA 331.79",
- "331.79"},
+ "331.79",
+ "NVIDIA"},
{"Gallium 0.4 on NVE7",
"nouveau",
"3.3 (Core Profile) Mesa 10.5.9",
- "10.5.9"},
+ "10.5.9",
+ "Mesa"},
{"Mesa DRI Intel(R) Haswell Mobile",
"Intel Open Source Technology Center",
"OpenGL ES 3.0 Mesa 12.1.0-devel (git-ed9dd3b)",
- "12.1.0"},
+ "12.1.0",
+ "Mesa"},
+ {"ASUS R5 230 Series",
+ "ATI Technologies Inc.",
+ "4.5.13399 Compatibility Profile Context 15.201.1151",
+ "15.201.1151",
+ NULL}, //TODO(j.isorce@samsung.com): this should be "ATI" or "AMD"
#endif
{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;
+ const auto& testStrings = kTestStrings[i];
+ gpu_info.gl_renderer = testStrings.gl_renderer;
+ gpu_info.gl_vendor = testStrings.gl_vendor;
+ gpu_info.gl_version = testStrings.gl_version;
EXPECT_EQ(CollectDriverInfoGL(&gpu_info), kCollectInfoSuccess);
- EXPECT_EQ(gpu_info.driver_version, kTestStrings[i].expected_driver_version);
+ EXPECT_EQ(gpu_info.driver_version, testStrings.expected_driver_version);
+ if (testStrings.expected_driver_vendor != nullptr) {
+ EXPECT_EQ(gpu_info.driver_vendor, testStrings.expected_driver_vendor);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698