diff options
author | chase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 00:50:41 +0000 |
---|---|---|
committer | chase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 00:50:41 +0000 |
commit | a857436bca04364cc7481994cb78ec7a56191dda (patch) | |
tree | 7ecb6b12661bf9d5f1dbd73a884ad6e090ec811e /tools/page_cycler | |
parent | d54ea7b7f8e8cc9bcc30afcfa1a34aeddc505864 (diff) | |
download | chromium_src-a857436bca04364cc7481994cb78ec7a56191dda.zip chromium_src-a857436bca04364cc7481994cb78ec7a56191dda.tar.gz chromium_src-a857436bca04364cc7481994cb78ec7a56191dda.tar.bz2 |
Fixed problem in IndexedDataBaseTest page_cycler.
This test was using an old head.js file which did not
get updated when the change to sessionStorage happened.
http://codereview.chromium.org/5866001/
BUG=68660
TEST=
I tested this page_cycler and it seems to be working fine.
Patch from Ahmad Sharif <asharif@chromium.org>,
originally at http://codereview.chromium.org/6079013/.
Review URL: http://codereview.chromium.org/6075013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70570 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/page_cycler')
-rw-r--r-- | tools/page_cycler/indexed_db/head.js | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/tools/page_cycler/indexed_db/head.js b/tools/page_cycler/indexed_db/head.js index a1b3149..4694a9c 100644 --- a/tools/page_cycler/indexed_db/head.js +++ b/tools/page_cycler/indexed_db/head.js @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -27,20 +27,21 @@ function getPropertyValue(name) { return ''; } -/** - * Returns the value of the '__pc_timings' property. - * @return {string} The list of all timings we got so far. - */ -function getTimings() { - return getPropertyValue('__pc_timings'); +function __get_timings() { + if (sessionStorage == null) + return __get_cookie("__pc_timings"); + else { + if (sessionStorage.getItem("__pc_timings") == null) + return ""; + else + return sessionStorage["__pc_timings"]; + } } - -/** - * Sets the value of the '__pc_timings' property in the cookie. - * @param {string} timings A comma-separated list of timings. - */ -function setTimings(timings) { - document.cookie = '__pc_timings=' + timings + '; path=/'; +function __set_timings(timings) { + if (sessionStorage == null) + document.cookie = "__pc_timings=" + timings + "; path=/"; + else + sessionStorage["__pc_timings"]=timings; } /** @@ -66,10 +67,10 @@ function nextCycleOrResults() { } var timings = elapsedTime; - var oldTimings = getTimings(); + var oldTimings = __get_timings(); if (oldTimings != '') timings = oldTimings + ',' + timings; - setTimings(timings); + __set_timings(timings); var url = doc + '?n=' + iterations + '&i=' + cycle + '&td=' + totalTime + '&tf=' + fudgeTime; |