| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 #include "ui/gl/gl_surface_egl.h" | 6 #include "ui/gl/gl_surface_egl.h" |
| 7 | 7 |
| 8 namespace { | 8 namespace { |
| 9 | 9 |
| 10 TEST(EGLInitializationDisplaysTest, DisableD3D11) { | 10 TEST(EGLInitializationDisplaysTest, DisableD3D11) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 TEST(EGLInitializationDisplaysTest, SwiftShader) { | 41 TEST(EGLInitializationDisplaysTest, SwiftShader) { |
| 42 std::unique_ptr<base::CommandLine> command_line( | 42 std::unique_ptr<base::CommandLine> command_line( |
| 43 new base::CommandLine(base::CommandLine::NO_PROGRAM)); | 43 new base::CommandLine(base::CommandLine::NO_PROGRAM)); |
| 44 | 44 |
| 45 std::vector<gl::DisplayType> displays; | 45 std::vector<gl::DisplayType> displays; |
| 46 | 46 |
| 47 // If swiftshader is requested, only SWIFT_SHADER should be returned | 47 // If swiftshader is requested, only SWIFT_SHADER should be returned |
| 48 command_line->AppendSwitchASCII(switches::kUseGL, | 48 command_line->AppendSwitchASCII(switches::kUseGL, |
| 49 gl::kGLImplementationSwiftShaderName); | 49 gl::kGLImplementationSwiftShaderForWebGLName); |
| 50 displays.clear(); | 50 displays.clear(); |
| 51 GetEGLInitDisplays(true, true, true, command_line.get(), &displays); | 51 GetEGLInitDisplays(true, true, true, command_line.get(), &displays); |
| 52 EXPECT_NE(std::find(displays.begin(), displays.end(), gl::SWIFT_SHADER), | 52 EXPECT_NE(std::find(displays.begin(), displays.end(), gl::SWIFT_SHADER), |
| 53 displays.end()); | 53 displays.end()); |
| 54 EXPECT_EQ(displays.size(), 1u); | 54 EXPECT_EQ(displays.size(), 1u); |
| 55 | 55 |
| 56 // Even if there are other flags, swiftshader should take prescedence | 56 // Even if there are other flags, swiftshader should take prescedence |
| 57 command_line->AppendSwitchASCII(switches::kUseANGLE, | 57 command_line->AppendSwitchASCII(switches::kUseANGLE, |
| 58 gl::kANGLEImplementationD3D11Name); | 58 gl::kANGLEImplementationD3D11Name); |
| 59 displays.clear(); | 59 displays.clear(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 // With no angle platform extensions, only DEFAULT should be available | 126 // With no angle platform extensions, only DEFAULT should be available |
| 127 std::vector<gl::DisplayType> displays; | 127 std::vector<gl::DisplayType> displays; |
| 128 GetEGLInitDisplays(false, false, false, command_line.get(), &displays); | 128 GetEGLInitDisplays(false, false, false, command_line.get(), &displays); |
| 129 EXPECT_NE(std::find(displays.begin(), displays.end(), gl::DEFAULT), | 129 EXPECT_NE(std::find(displays.begin(), displays.end(), gl::DEFAULT), |
| 130 displays.end()); | 130 displays.end()); |
| 131 EXPECT_EQ(displays.size(), 1u); | 131 EXPECT_EQ(displays.size(), 1u); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace | 134 } // namespace |
| OLD | NEW |