parameters: (self, func, file)
docstring: Overrriden from TypeHandler.
docstring_summary: Overrriden from TypeHandler.
docstring_tokens: Overrriden from TypeHandler .
function: def WriteImmediateServiceUnitTest(self, func, file):
      """Overrriden from TypeHandler."""
      valid_test = """
  TEST_F(%(test_name)s, %(name)sValidArgs) {
    EXPECT_CALL(
        *gl_,
        %(gl_func_name)s(1, Pointee(kService%(upper_resource_name)sId)))
        .Times(1);
    %(name)s& cmd = *GetImmediateAs<%(name)s>();
    SpecializedSetup<%(name)s, 0>(true);
    cmd.Init(1, &client_%(resource_name)s_id_);
    EXPECT_EQ(error::kNoError,
              ExecuteImmediateCmd(cmd, sizeof(client_%(resource_name)s_id_)));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
    EXPECT_TRUE(
        Get%(upper_resource_name)sInfo(client_%(resource_name)s_id_) == NULL);
  }
  """
      self.WriteValidUnitTest(func, file, valid_test, {
            'resource_name': func.GetInfo('resource_type').lower(),
            'upper_resource_name': func.GetInfo('resource_type'),
          })
      invalid_test = """
  TEST_F(%(test_name)s, %(name)sInvalidArgs) {
    %(name)s& cmd = *GetImmediateAs<%(name)s>();
    SpecializedSetup<%(name)s, 0>(false);
    GLuint temp = kInvalidClientId;
    cmd.Init(1, &temp);
    EXPECT_EQ(error::kNoError,
              ExecuteImmediateCmd(cmd, sizeof(temp)));
  }
  """
      self.WriteValidUnitTest(func, file, invalid_test)
function_tokens: def WriteImmediateServiceUnitTest ( self , func , file ) : valid_test = """
  TEST_F(%(test_name)s, %(name)sValidArgs) {
    EXPECT_CALL(
        *gl_,
        %(gl_func_name)s(1, Pointee(kService%(upper_resource_name)sId)))
        .Times(1);
    %(name)s& cmd = *GetImmediateAs<%(name)s>();
    SpecializedSetup<%(name)s, 0>(true);
    cmd.Init(1, &client_%(resource_name)s_id_);
    EXPECT_EQ(error::kNoError,
              ExecuteImmediateCmd(cmd, sizeof(client_%(resource_name)s_id_)));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
    EXPECT_TRUE(
        Get%(upper_resource_name)sInfo(client_%(resource_name)s_id_) == NULL);
  }
  """ self . WriteValidUnitTest ( func , file , valid_test , { 'resource_name' : func . GetInfo ( 'resource_type' ) . lower ( ) , 'upper_resource_name' : func . GetInfo ( 'resource_type' ) , } ) invalid_test = """
  TEST_F(%(test_name)s, %(name)sInvalidArgs) {
    %(name)s& cmd = *GetImmediateAs<%(name)s>();
    SpecializedSetup<%(name)s, 0>(false);
    GLuint temp = kInvalidClientId;
    cmd.Init(1, &temp);
    EXPECT_EQ(error::kNoError,
              ExecuteImmediateCmd(cmd, sizeof(temp)));
  }
  """ self . WriteValidUnitTest ( func , file , invalid_test )