Sometimes, browser_tests fails only on VM, not on your workstation, and you need to debug it on VM.
You should adjust the path to the qemu image.
First time, it takes several minutes as it packs dependencies (including browser_tests binary) and copies them to the VM. From the second time, you can make it faster by adding skip_deps to --args:
At the end of the output, you'll see something like:
The detailed test output can be found deep under the directory:
Once you fix the test in Chrome tree, run the following to rebuild Chrome as well as the tests. Note that you should set CHROME_ORIGIN=LOCAL_SOURCE to build Chrome from your local tree.
Then, run the following to rerun the test.
Be sure NOT to add 'skip_deps' here. You need to reprocess the dependencies so the new browser_tests binary gets copied to the VM.
The test binaries copied to VM have no symbol information attached. Hence you'll only see raw addresses from CHECK failures, like:
To see symbolized crash dump, you need to take extra steps (we should make it easier though):
With chrome_debug_tests, you'll have unstripped binaries in /var/lib/portage/distfiles-target/chrome-src/src/out_x86-generic/Release. An unstripped browser_tests can be as big as 900MB. If you are only interested in symbol names, not detailed debug info, you can strip the debug info but keep the symbol names, which results in a binary of 100MB, to make copying the file to VM faster.
Be sure to add 'skip_deps' here. Otherwise, autotest will overwrite browser_tests again.
If you set USE=-build_tests in the chroot, you may encounter the following error when running run_remote_tests.
If you see the error, just run the following in the chroot.
This will build browser_tests and other files which are necessary to run tests on VM.