Chromium Code Reviews| 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 359461ad92766409bf53d5514c478ad2033a8c94..f145549d560ad72e72ae02545a8ba2922f49bd2a 100644 |
| --- a/gpu/config/gpu_info_collector_unittest.cc |
| +++ b/gpu/config/gpu_info_collector_unittest.cc |
| @@ -151,5 +151,48 @@ TEST_F(GPUInfoCollectorTest, CollectGraphicsInfoGL) { |
| EXPECT_EQ(test_values_.gl_extensions, gpu_info.gl_extensions); |
| } |
| +class CollectDriverInfoGLTest : public testing::Test { |
| + public: |
| + CollectDriverInfoGLTest() {} |
| + ~CollectDriverInfoGLTest() override {} |
| + |
| + void SetUp() override { |
| + } |
| + void TearDown() override { |
| + } |
| +}; |
| + |
| +TEST_F(CollectDriverInfoGLTest, CollectDriverInfoGL) { |
| + const struct { |
| + const char* gl_renderer; |
| + const char* gl_vendor; |
| + const char* gl_version; |
| + const char* expected_driver_version; |
| + } tests[] = { |
|
no sievers
2015/06/03 20:28:13
nit: s/tests/kTestStrings or so
|
| +#if defined(OS_ANDROID) |
|
no sievers
2015/06/03 20:28:13
nit: I'd ifdef out the whole test thingie and put
|
| + {"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"}, |
| + {"PowerVR Rogue G6430", "Imagination Technologies", |
| + "OpenGL ES 3.1 build 1.4@3283119", "1.4"}, |
| + {"Mali-T604", "ARM", "OpenGL ES 3.1", "0"}, |
| + {"NVIDIA Tegra", "NVIDIA Corporation", "OpenGL ES 3.1 NVIDIA 343.00", |
| + "343.00"}, |
|
no sievers
2015/06/03 20:28:14
Can you also update the comment in gpu_info_collec
|
| + {"NVIDIA Tegra 3", "NVIDIA Corporation", "OpenGL ES 2.0 14.01003", |
| + "14.01003"}, |
| +#endif |
| + {NULL, NULL, NULL, NULL} |
| + }; |
| + |
| + GPUInfo gpu_info; |
| + for (int i = 0; tests[i].gl_renderer != NULL; ++i) { |
| + gpu_info.gl_renderer = tests[i].gl_renderer; |
| + gpu_info.gl_vendor = tests[i].gl_vendor; |
| + gpu_info.gl_version = tests[i].gl_version; |
| + EXPECT_EQ(CollectDriverInfoGL(&gpu_info), kCollectInfoSuccess); |
| + EXPECT_EQ(gpu_info.driver_version, tests[i].expected_driver_version); |
| + } |
| +} |
| + |
| } // namespace gpu |