Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc |
index 35a8197003c623dd8f30e70c19e45924bd304a9b..10e31d130cfad26f655c5e4cc8ebaa5815f9cdf8 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc |
@@ -450,6 +450,38 @@ TEST_P(GLES3DecoderTest, ES3PixelStoreiWithPixelUnpackBuffer) { |
DoBindBuffer(GL_PIXEL_UNPACK_BUFFER, client_buffer_id_, kServiceBufferId); |
} |
+TEST_P(GLES2DecoderManualInitTest, MipmapHintOnCoreProfile) { |
+ // On a core profile, glHint(GL_GENERATE_MIPMAP_HINT) should be a noop |
+ InitState init; |
+ init.gl_version = "3.2"; |
+ InitDecoder(init); |
+ |
+ cmds::Hint cmd; |
+ cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_NICEST); |
+ |
+ EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_NICEST)).Times(0); |
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
+ EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
+} |
+ |
+TEST_P(GLES2DecoderManualInitTest, MipmapHintOnCompatibilityProfile) { |
+ // On a compatibility profile, glHint(GL_GENERATE_MIPMAP_HINT) should be go |
+ // through |
+ InitState init; |
+ init.gl_version = "3.2"; |
+ init.extensions += " GL_ARB_compatibility"; |
+ InitDecoder(init); |
+ |
+ cmds::Hint cmd; |
+ cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_NICEST); |
+ |
+ EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_NICEST)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
+ EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
+} |
+ |
// TODO(vmiura): Tests for VAO restore. |
// TODO(vmiura): Tests for ContextState::RestoreAttribute(). |