OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include <memory> | |
6 | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 #include "ui/gl/gl_version_info.h" | |
9 | |
10 namespace gl { | |
11 | |
12 TEST(GLVersionInfoTest, MajorMinorVersionTest) { | |
13 const char* version_str[] = {"4.3 (Core Profile) Mesa 11.2.0", | |
14 "4.5.0 NVIDIA 364.19", | |
15 "OpenGL ES 2.0 (ANGLE 2.1.0.cd1b12260360)", | |
16 "2.1 INTEL-10.6.33"}; | |
17 const char* renderer_str[] = {NULL, NULL, NULL, NULL}; | |
18 const char* extensions_str[] = {"extensions", "extensions", | |
19 "extensions", "extensions"}; | |
20 unsigned expected_major[] = {4, 4, 2, 2}; | |
21 unsigned expected_minor[] = {3, 5, 0, 1}; | |
22 std::unique_ptr<GLVersionInfo> version_info; | |
23 for (unsigned i = 0; i < arraysize(version_str); i++) { | |
24 version_info.reset(new GLVersionInfo(version_str[i], | |
25 renderer_str[i], extensions_str[i])); | |
Zhenyao Mo
2016/06/21 17:27:21
nit: four indent instead of two.
| |
26 unsigned major, minor; | |
27 bool is_es, is_es2, is_es3; | |
28 version_info->ParseVersionString(version_str[i], &major, &minor, | |
29 &is_es, &is_es2, &is_es3); | |
30 EXPECT_EQ(major, expected_major[i]); | |
31 EXPECT_EQ(minor, expected_minor[i]); | |
32 } | |
33 } | |
34 | |
35 } | |
OLD | NEW |