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

Side by Side Diff: gpu/command_buffer/service/shader_translator_unittest.cc

Issue 5626008: Exposed support for dynamically enabling extensions in command buffer... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/service/shader_translator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "gpu/command_buffer/service/shader_translator.h" 5 #include "gpu/command_buffer/service/shader_translator.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace gpu { 8 namespace gpu {
9 namespace gles2 { 9 namespace gles2 {
10 10
11 class ShaderTranslatorTest : public testing::Test { 11 class ShaderTranslatorTest : public testing::Test {
12 public: 12 public:
13 ShaderTranslatorTest() { 13 ShaderTranslatorTest() {
14 } 14 }
15 15
16 ~ShaderTranslatorTest() { 16 ~ShaderTranslatorTest() {
17 } 17 }
18 18
19 protected: 19 protected:
20 virtual void SetUp() { 20 virtual void SetUp() {
21 ShBuiltInResources resources; 21 ShBuiltInResources resources;
22 ShInitBuiltInResources(&resources); 22 ShInitBuiltInResources(&resources);
23 23
24 ASSERT_TRUE(vertex_translator_.Init( 24 ASSERT_TRUE(vertex_translator_.Init(
25 SH_VERTEX_SHADER, SH_GLES2_SPEC, &resources)); 25 SH_VERTEX_SHADER, SH_GLES2_SPEC, &resources, false));
26 ASSERT_TRUE(fragment_translator_.Init( 26 ASSERT_TRUE(fragment_translator_.Init(
27 SH_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources)); 27 SH_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources, false));
28 // Post-init the results must be empty. 28 // Post-init the results must be empty.
29 // Vertex translator results. 29 // Vertex translator results.
30 EXPECT_TRUE(vertex_translator_.translated_shader() == NULL); 30 EXPECT_TRUE(vertex_translator_.translated_shader() == NULL);
31 EXPECT_TRUE(vertex_translator_.info_log() == NULL); 31 EXPECT_TRUE(vertex_translator_.info_log() == NULL);
32 EXPECT_TRUE(vertex_translator_.attrib_map().empty()); 32 EXPECT_TRUE(vertex_translator_.attrib_map().empty());
33 EXPECT_TRUE(vertex_translator_.uniform_map().empty()); 33 EXPECT_TRUE(vertex_translator_.uniform_map().empty());
34 // Fragment translator results. 34 // Fragment translator results.
35 EXPECT_TRUE(fragment_translator_.translated_shader() == NULL); 35 EXPECT_TRUE(fragment_translator_.translated_shader() == NULL);
36 EXPECT_TRUE(fragment_translator_.info_log() == NULL); 36 EXPECT_TRUE(fragment_translator_.info_log() == NULL);
37 EXPECT_TRUE(fragment_translator_.attrib_map().empty()); 37 EXPECT_TRUE(fragment_translator_.attrib_map().empty());
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // Second uniform. 173 // Second uniform.
174 iter = uniform_map.find("bar[1].foo.color[0]"); 174 iter = uniform_map.find("bar[1].foo.color[0]");
175 EXPECT_TRUE(iter != uniform_map.end()); 175 EXPECT_TRUE(iter != uniform_map.end());
176 EXPECT_EQ(SH_FLOAT_VEC4, iter->second.type); 176 EXPECT_EQ(SH_FLOAT_VEC4, iter->second.type);
177 EXPECT_EQ(1, iter->second.size); 177 EXPECT_EQ(1, iter->second.size);
178 } 178 }
179 179
180 } // namespace gles2 180 } // namespace gles2
181 } // namespace gpu 181 } // namespace gpu
182 182
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/shader_translator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698