This tests that we can successfully profile a wasm application and view the file, the accumulated time as well as the call tree.
Steps
- Open DevTools
- Open the Performance Tab
- Click the record button
- Reload the page and wait for application to finish (console output appears)
- Stop the recording
- Check if the performance tab reflects the correct info:
Check "Summary" tab:
- Search for "main" (CMD/CTRL-F)
- The "Summary" tab shows a non-zero total time for "main"
- Clicking on the function link should redirect to the "profiling.wasm" file in the Sources tab
Check "Bottom Up" tab:
- Search for "main" (CMD/CTRL-F)
- Click on the "Bottom Up" Tab
- Expand the tree for "main"; it should show: "main", "js-to-wasm:.*", "(anonymous)", "Run Microtasks
Check "Call Tree" tab:
- Search for "main" (CMD/CTRL-F)
- Click on the "Call Tree" tab
- Expand the tree for "Run Microtasks"; it should show: "Run Microtasks", "(anonymous)", "js-to-wasm:.*", "main", "getTime"
- Clear the profile