From a54e8115696da36621cb06388cc9589270abc00e Mon Sep 17 00:00:00 2001 From: "tonyg@google.com" Date: Fri, 26 Apr 2013 18:03:45 +0000 Subject: Fix indexed_db page cycler. This was broken when the test switched over to being run with telemetry because telemetry waits for the document.readyState to be "complete" and a late document.write() causes the readyState to go back to "loading". This patch fixes that by changing the test's logging method to appending to a log div rather than document.write()ing after the page has loaded. BUG=235350 TEST=tools/perf/run_multipage_benchmarks --browser=system page_cycler tools/perf/page_sets/page_cycler/indexed_db/basic_insert.json Review URL: https://codereview.chromium.org/14383008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196773 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/page_cycler/indexed_db/common.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/page_cycler/indexed_db/common.js b/tools/page_cycler/indexed_db/common.js index 1af6611..18d3607 100644 --- a/tools/page_cycler/indexed_db/common.js +++ b/tools/page_cycler/indexed_db/common.js @@ -16,6 +16,17 @@ function setup() { return false; } -function log(msg) { - document.write(msg + '
'); +function getOrAddElement(id, type) { + var elem = document.getElementById(id); + if (!elem) { + elem = document.createElement(type); + elem.id = id; + document.body.appendChild(elem); + } + return elem; } + +function log(msg) { + var logElem = getOrAddElement('logElem', 'DIV'); + logElem.innerHTML += msg + '
'; +} \ No newline at end of file -- cgit v1.1