parameters: (self, func, file)
docstring: Overridden from TypeHandler.
docstring_summary: Overridden from TypeHandler.
docstring_tokens: Overridden from TypeHandler .
function: def WriteServiceUnitTest(self, func, file):
      """Overridden from TypeHandler."""
      TypeHandler.WriteServiceUnitTest(self, func, file)
  
      valid_test = """
  TEST_F(%(test_name)s, %(name)sValidArgsCountTooLarge) {
    EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
    SpecializedSetup<cmds::%(name)s, 0>(true);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """
      gl_arg_strings = []
      arg_strings = []
      for count, arg in enumerate(func.GetOriginalArgs()):
        # hardcoded to match unit tests.
        if count == 0:
          # the location of the second element of the 2nd uniform.
          # defined in GLES2DecoderBase::SetupShaderForUniform
          gl_arg_strings.append("3")
          arg_strings.append("ProgramManager::MakeFakeLocation(1, 1)")
        elif count == 1:
          # the number of elements that gl will be called with.
          gl_arg_strings.append("3")
          # the number of elements requested in the command.
          arg_strings.append("5")
        else:
          gl_arg_strings.append(arg.GetValidGLArg(func, count, 0))
          arg_strings.append(arg.GetValidArg(func, count, 0))
      extra = {
        'gl_args': ", ".join(gl_arg_strings),
        'args': ", ".join(arg_strings),
      }
      self.WriteValidUnitTest(func, file, valid_test, extra)
function_tokens: def WriteServiceUnitTest ( self , func , file ) : TypeHandler . WriteServiceUnitTest ( self , func , file ) valid_test = """
  TEST_F(%(test_name)s, %(name)sValidArgsCountTooLarge) {
    EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
    SpecializedSetup<cmds::%(name)s, 0>(true);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """ gl_arg_strings = [ ] arg_strings = [ ] for count , arg in enumerate ( func . GetOriginalArgs ( ) ) : # hardcoded to match unit tests. if count == 0 : # the location of the second element of the 2nd uniform. # defined in GLES2DecoderBase::SetupShaderForUniform gl_arg_strings . append ( "3" ) arg_strings . append ( "ProgramManager::MakeFakeLocation(1, 1)" ) elif count == 1 : # the number of elements that gl will be called with. gl_arg_strings . append ( "3" ) # the number of elements requested in the command. arg_strings . append ( "5" ) else : gl_arg_strings . append ( arg . GetValidGLArg ( func , count , 0 ) ) arg_strings . append ( arg . GetValidArg ( func , count , 0 ) ) extra = { 'gl_args' : ", " . join ( gl_arg_strings ) , 'args' : ", " . join ( arg_strings ) , } self . WriteValidUnitTest ( func , file , valid_test , extra )