Пример #1
0
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)
}
Пример #2
0
func (v *accountDirectGlibIdleAddMock) IdleAdd(v1 interface{}, v2 ...interface{}) (glibi.SourceHandle, error) {
	ffx := v1.(func())
	ffx()
	return glibi.SourceHandle(0), nil
}
Пример #3
0
func (*Mock) IdleAdd(f interface{}, args ...interface{}) (glibi.SourceHandle, error) {
	return glibi.SourceHandle(0), nil
}
Пример #4
0
func (*RealGlib) IdleAdd(f interface{}, args ...interface{}) (glibi.SourceHandle, error) {
	res, err := glib.IdleAdd(f, args...)
	return glibi.SourceHandle(res), err
}