func (*UIThreadSuite) Test_doInUIThread(c *C) { m := &glibIdleAddMock{} g = Graphics{glib: m} m.f = func(ff interface{}, vals ...interface{}) (glibi.SourceHandle, error) { ffx := ff.(func()) ffx() return glibi.SourceHandle(0), nil } ran := false doInUIThread(func() { ran = true }) c.Assert(ran, Equals, true) }
func (v *accountDirectGlibIdleAddMock) IdleAdd(v1 interface{}, v2 ...interface{}) (glibi.SourceHandle, error) { ffx := v1.(func()) ffx() return glibi.SourceHandle(0), nil }
func (*Mock) IdleAdd(f interface{}, args ...interface{}) (glibi.SourceHandle, error) { return glibi.SourceHandle(0), nil }
func (*RealGlib) IdleAdd(f interface{}, args ...interface{}) (glibi.SourceHandle, error) { res, err := glib.IdleAdd(f, args...) return glibi.SourceHandle(res), err }