11 property var contextInPaint
22 signalName: "contextChanged"
26 contextInPaint = context;
30 name: "ContextTypeStored"
33 function test_contextType() {
34 compare(canvas.contextType, "2d");
39 name: "ContextValidWhenTypePredefined"
40 when: canvas.available
42 function test_context() {
43 // Wait for the context to become active
45 compare(contextSpy.count, 1);
47 // Context is available
48 verify(canvas.context)
51 function test_contextIsConsistent() {
52 // Wait for the context to become active
54 compare(contextSpy.count, 1);
56 // getContext("2d") is the same as the context property
57 compare(canvas.getContext("2d"), canvas.context);
60 function test_paintHadContext() {
61 // Make there was a paint signal
63 verify(paintedSpy.count, 1)
65 // Paint was called with a valid context when contextType is
67 verify(canvas.contextInPaint)
69 // paints context was the correct one
70 compare(canvas.contextInPaint, canvas.getContext("2d"));