You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: util_test.go
    path of file: ./repos/chromedp
    
    the code of the file until where you have to start completion: package chromedp

import (
	"context"
	"fmt"
	"net/http"
	"net/http/httptest"
	"strconv"
	"testing"
	"time"

	"github.com/chromedp/cdproto/cdp"
	"github.com/chromedp/cdproto/runtime"
)

// dumpJS is a JavaScript snippet that du
    
func TestNodeOp(t *testing.T) {
	t.Parallel()

	s := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
		fmt.Fprintf(res, `<!doctype html>
<html>
  <head>
    <title>empty test page</title>
  </head>
  <body>
    <div id="div1">div1 content</div>
  </body>
<html>`)
	}))
	defer s.Close()

	ctx, cancel := testAllocate(t, "")
	defer cancel()

	// get document root
	var nodes []*cdp.Node
	if err := Run(ctx,
		Navigate(s.URL),
		Nodes(`//*`, &nodes),
		Nodes(`document`, &nodes, ByJSPath),
	); err != nil {
		t.Fatal(err)
	}

	tests := []struct {
		q, expr string
	}{
		{`body`, `n.insertBefore(el, n.childNodes[0])`},
		{`body`, `n.insertBefore(el, n.childNodes[1])`},
		{`#div3`, `n.prepend(el)`},
		{`#div2`, `n.append(el)`},
		{`#div2`, `n.appendChild(el)`},
		{`#div3`, `n.removeChild(n.childNodes[0])`},
		{`#div2`, `n.insertAdjacentElement('afterend', el)`},
		{`body`, `n.insertBefore(el, n.childNodes[0])`},
		{`body`, `n.insertBefore(el, n.childNodes[1])`},
		{`#div2`, `n.replaceChild(el, n.childNodes[1])`},
	}

	prev := nodes[0].Dump("", "  ", false)
	for i, test := range tests {
		// modify tree
		if err := Run(ctx,
			ActionFunc(func(ctx context.Context) error {
				id := strconv.Itoa(i + 2)
				expr := fmt.Sprintf(insertJS, test.expr, test.q, `div`, `div`+id, `div`+id+` content`)
				_, exp, err := runtime.Evaluate(expr).Do(ctx)
				if err != nil {
					return err
				}
				if exp != nil {
					return exp
				}
				return nil
			}),
		); err != nil {
			t.Fatal(err)
		}

		// wait for events to propagate
		time.Sleep(5 * time.Millisecond)

		tree := nodes[0].Dump("", "  ", false)
		if prev == tree {
			t.Fatalf("test %d expected tree to change (prev == tree)\n-- PREV:\n%s\n-- TREE:\n%s\n--\n", i, prev, tree)
		}

		// retrieve browser's tree view
		var exp string
		if err := Run(ctx,
			EvaluateAsDevTools(fmt.Sprintf(dumpJS, `document`, "", "  ", false), &exp),
		); err != nil {
			t.Fatal(err)
		}

		if exp != tree {
			t.Errorf("test %d expected tree and node tree do not match:\n-- EXPECTED:\n%s\n-- GOT:\n%s\n--\n", i, exp, tree)
		}

		prev = tree

		// t.Logf("test %d:\n%s\n--\n", i, tree)
	}
}