diff --git a/widget/button_test.go b/widget/button_test.go index caf104b0..bc0ccf8d 100644 --- a/widget/button_test.go +++ b/widget/button_test.go @@ -6,7 +6,6 @@ import ( "image" "testing" - "gioui.org/app" "gioui.org/io/input" "gioui.org/io/key" "gioui.org/layout" @@ -16,12 +15,14 @@ import ( func TestClickable(t *testing.T) { var ( - ops op.Ops - r input.Router - b1 widget.Clickable - b2 widget.Clickable + r input.Router + b1 widget.Clickable + b2 widget.Clickable ) - gtx := app.NewContext(&ops, app.FrameEvent{Source: r.Source()}) + gtx := layout.Context{ + Ops: new(op.Ops), + Source: r.Source(), + } layout := func() { b1.Layout(gtx, func(gtx layout.Context) layout.Dimensions { return layout.Dimensions{Size: image.Pt(100, 100)} @@ -32,7 +33,7 @@ func TestClickable(t *testing.T) { }) } frame := func() { - ops.Reset() + gtx.Reset() layout() r.Frame(gtx.Ops) } diff --git a/widget/widget_test.go b/widget/widget_test.go index 08183ebd..abf05509 100644 --- a/widget/widget_test.go +++ b/widget/widget_test.go @@ -6,7 +6,6 @@ import ( "image" "testing" - "gioui.org/app" "gioui.org/f32" "gioui.org/io/input" "gioui.org/io/pointer" @@ -18,11 +17,13 @@ import ( func TestBool(t *testing.T) { var ( - ops op.Ops - r input.Router - b widget.Bool + r input.Router + b widget.Bool ) - gtx := app.NewContext(&ops, app.FrameEvent{Source: r.Source()}) + gtx := layout.Context{ + Ops: new(op.Ops), + Source: r.Source(), + } layout := func() { b.Layout(gtx, func(gtx layout.Context) layout.Dimensions { semantic.CheckBox.Add(gtx.Ops) @@ -44,7 +45,7 @@ func TestBool(t *testing.T) { Position: f32.Pt(50, 50), }, ) - ops.Reset() + gtx.Reset() layout() r.Frame(gtx.Ops) tree := r.AppendSemantics(nil)