This tests that we can successfully profile a wasm application and view the file, the accumulated time as well as the call tree.

Steps

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