android: Wait for Chrome to finish writing trace file before downloading
When downloading the latest trace file from Chrome, wait for Chrome to
actually finish writing it to avoid getting back a partially written
trace.
Chrome logs two different messages related to tracing:
1. "Logging performance trace to file [...]"
2. "Profiler finished. Results are in [...]"
The first one is printed when tracing starts and the second one indicates
that the trace file is ready to be downloaded.
We have to look for both of these messages to make sure we get the results
from the latest trace and that the trace file is complete. This is done by
first looking for the last instance of the first message and then checking
for the second message in the remaining part of the log.
Review URL: https://chromiumcodereview.appspot.com/
23477016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220298 0039d316-1c4b-4281-b951-d872f2087c98