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

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

Issue 2291753002: Prevent crash when using getExtension while a PBO is bound. (Closed)
Patch Set: small corrections Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/context_group.h" 5 #include "gpu/command_buffer/service/context_group.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 EXPECT_TRUE(group_->buffer_manager() == NULL); 64 EXPECT_TRUE(group_->buffer_manager() == NULL);
65 EXPECT_TRUE(group_->framebuffer_manager() == NULL); 65 EXPECT_TRUE(group_->framebuffer_manager() == NULL);
66 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); 66 EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
67 EXPECT_TRUE(group_->texture_manager() == NULL); 67 EXPECT_TRUE(group_->texture_manager() == NULL);
68 EXPECT_TRUE(group_->program_manager() == NULL); 68 EXPECT_TRUE(group_->program_manager() == NULL);
69 EXPECT_TRUE(group_->shader_manager() == NULL); 69 EXPECT_TRUE(group_->shader_manager() == NULL);
70 } 70 }
71 71
72 TEST_F(ContextGroupTest, InitializeNoExtensions) { 72 TEST_F(ContextGroupTest, InitializeNoExtensions) {
73 TestHelper::SetupContextGroupInitExpectations( 73 TestHelper::SetupContextGroupInitExpectations(
74 gl_.get(), DisallowedFeatures(), "", "", kBindGeneratesResource); 74 gl_.get(), DisallowedFeatures(), "", "",
75 CONTEXT_TYPE_OPENGLES2, kBindGeneratesResource);
75 group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2, 76 group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2,
76 DisallowedFeatures()); 77 DisallowedFeatures());
77 EXPECT_EQ(static_cast<uint32_t>(TestHelper::kNumVertexAttribs), 78 EXPECT_EQ(static_cast<uint32_t>(TestHelper::kNumVertexAttribs),
78 group_->max_vertex_attribs()); 79 group_->max_vertex_attribs());
79 EXPECT_EQ(static_cast<uint32_t>(TestHelper::kNumTextureUnits), 80 EXPECT_EQ(static_cast<uint32_t>(TestHelper::kNumTextureUnits),
80 group_->max_texture_units()); 81 group_->max_texture_units());
81 EXPECT_EQ(static_cast<uint32_t>(TestHelper::kMaxTextureImageUnits), 82 EXPECT_EQ(static_cast<uint32_t>(TestHelper::kMaxTextureImageUnits),
82 group_->max_texture_image_units()); 83 group_->max_texture_image_units());
83 EXPECT_EQ(static_cast<uint32_t>(TestHelper::kMaxVertexTextureImageUnits), 84 EXPECT_EQ(static_cast<uint32_t>(TestHelper::kMaxVertexTextureImageUnits),
84 group_->max_vertex_texture_image_units()); 85 group_->max_vertex_texture_image_units());
(...skipping 15 matching lines...) Expand all
100 EXPECT_TRUE(group_->framebuffer_manager() == NULL); 101 EXPECT_TRUE(group_->framebuffer_manager() == NULL);
101 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); 102 EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
102 EXPECT_TRUE(group_->texture_manager() == NULL); 103 EXPECT_TRUE(group_->texture_manager() == NULL);
103 EXPECT_TRUE(group_->program_manager() == NULL); 104 EXPECT_TRUE(group_->program_manager() == NULL);
104 EXPECT_TRUE(group_->shader_manager() == NULL); 105 EXPECT_TRUE(group_->shader_manager() == NULL);
105 } 106 }
106 107
107 TEST_F(ContextGroupTest, MultipleContexts) { 108 TEST_F(ContextGroupTest, MultipleContexts) {
108 std::unique_ptr<MockGLES2Decoder> decoder2_(new MockGLES2Decoder()); 109 std::unique_ptr<MockGLES2Decoder> decoder2_(new MockGLES2Decoder());
109 TestHelper::SetupContextGroupInitExpectations( 110 TestHelper::SetupContextGroupInitExpectations(
110 gl_.get(), DisallowedFeatures(), "", "", kBindGeneratesResource); 111 gl_.get(), DisallowedFeatures(), "", "",
112 CONTEXT_TYPE_OPENGLES2, kBindGeneratesResource);
111 EXPECT_TRUE(group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2, 113 EXPECT_TRUE(group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2,
112 DisallowedFeatures())); 114 DisallowedFeatures()));
113 EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_WEBGL1, 115 EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_WEBGL1,
114 DisallowedFeatures())); 116 DisallowedFeatures()));
115 EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_WEBGL2, 117 EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_WEBGL2,
116 DisallowedFeatures())); 118 DisallowedFeatures()));
117 EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_OPENGLES3, 119 EXPECT_FALSE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_OPENGLES3,
118 DisallowedFeatures())); 120 DisallowedFeatures()));
119 EXPECT_TRUE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_OPENGLES2, 121 EXPECT_TRUE(group_->Initialize(decoder2_.get(), CONTEXT_TYPE_OPENGLES2,
120 DisallowedFeatures())); 122 DisallowedFeatures()));
(...skipping 21 matching lines...) Expand all
142 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); 144 EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
143 EXPECT_TRUE(group_->texture_manager() == NULL); 145 EXPECT_TRUE(group_->texture_manager() == NULL);
144 EXPECT_TRUE(group_->program_manager() == NULL); 146 EXPECT_TRUE(group_->program_manager() == NULL);
145 EXPECT_TRUE(group_->shader_manager() == NULL); 147 EXPECT_TRUE(group_->shader_manager() == NULL);
146 } 148 }
147 149
148 } // namespace gles2 150 } // namespace gles2
149 } // namespace gpu 151 } // namespace gpu
150 152
151 153
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698