MCPcopy Create free account
hub / github.com/google/pprof / TestSource

Function TestSource

browsertests/browser_test.go:95–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93var jsCheckFlame string
94
95func TestSource(t *testing.T) {
96 maybeSkipBrowserTest(t)
97
98 prof := makeFakeProfile()
99 server := makeTestServer(t, prof)
100 ctx := newContext(context.Background(), t)
101
102 err := chromedp.Run(ctx,
103 chromedp.Navigate(server.URL+"/source?f=F3"),
104 chromedp.WaitVisible(`#content`, chromedp.ByID),
105 matchRegexp(t, "#content", `F3`), // Header
106 matchRegexp(t, "#content", `Total:.*100ms`), // Total for function
107 matchRegexp(t, "#content", `\b22\b.*100ms`), // Line 22
108 )
109 if err != nil {
110 t.Fatal(err)
111 }
112}
113
114func newContext(ctx context.Context, t *testing.T) context.Context {
115 opts := append(chromedp.DefaultExecAllocatorOptions[:],

Callers

nothing calls this directly

Calls 5

maybeSkipBrowserTestFunction · 0.85
newContextFunction · 0.85
matchRegexpFunction · 0.85
makeFakeProfileFunction · 0.70
makeTestServerFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…