Add tests for tor circuit panel
When we have our test infrastructure, here are some features to test from #41600 (closed):
- The toolbar button is hidden for pages with no circuit. Like "about:" pages, but also more obscure pages like
data:text/plain,hello
. - The toolbar button is shown for web pages. Clicking or pressing Space or Enter on the toolbar button opens the panel, takes focus into the panel, and shows the circuit.
- When using a bridge, the first circuit node is a bridge node. Otherwise the first circuit node is marked as a guard.
- Onion sites show an extra "onion relays" item in the circuit.
- Onion site names are shortened.
- Pages with onion aliases show the alias in the panel header. Clicking the alias opens it in a new tab. It also has a context menu to copy the link, open in a new tab, or open in a new window.
- Switching tabs whilst the panel is open will update the panel for the new page's circuit, or close the panel if the new tab has no circuit. E.g. with Ctrl+Tab.
- Clicking the "New circuit for this site" will close the panel and reload the page with a new circuit. If the panel is re-opened whilst the new circuit is still be established (e.g. for onion sites it can take a while) then the old circuit is still shown.
- Triggering a new circuit whilst the panel is open with Ctrl+Shift+L will not close the panel, and once the new cirucit is found the circuit display is updated.