(c *C)
| 263 | } |
| 264 | |
| 265 | func (s *S) TestComponentCreateWindow(c *C) { |
| 266 | data := ` |
| 267 | import QtQuick 2.0 |
| 268 | Item { width: 300; height: 200; } |
| 269 | ` |
| 270 | component, err := s.engine.LoadString("file.qml", data) |
| 271 | c.Assert(err, IsNil) |
| 272 | |
| 273 | // TODO How to test this more effectively? |
| 274 | window := component.CreateWindow(nil) |
| 275 | window.Show() |
| 276 | |
| 277 | // Just a smoke test, as there isn't much to assert. |
| 278 | c.Assert(window.PlatformId(), Not(Equals), uintptr(0)) |
| 279 | |
| 280 | // Qt doesn't hide the Window if we call it too quickly. :-( |
| 281 | time.Sleep(100 * time.Millisecond) |
| 282 | window.Hide() |
| 283 | } |
| 284 | |
| 285 | func (s *S) TestContextSpawn(c *C) { |
| 286 | context1 := s.engine.Context() |
nothing calls this directly
no test coverage detected