summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-09-26 02:46:41 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-09-26 02:46:41 +0000
commiteefb0b2d6ed65a9f8e17931e69eef56d1c92430e (patch)
treedfe7312ff0c001ae4ef2a01098a3aebdabaf4850 /share
parent0fe42b207eb98a965cddff9f55942cc916e7cc5e (diff)
Fix the UUID's test failures when clocks are out of sync.
Changes the tests for cache busting by using ETag's. Left the date tests commented out just in case someone thinks I'm crazy and sees a better solution. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@819091 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/uuids.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/share/www/script/test/uuids.js b/share/www/script/test/uuids.js
index 50621678..4de7ce90 100644
--- a/share/www/script/test/uuids.js
+++ b/share/www/script/test/uuids.js
@@ -11,16 +11,25 @@
// the License.
couchTests.uuids = function(debug) {
+ var etags = [];
var testHashBustingHeaders = function(xhr) {
T(xhr.getResponseHeader("Cache-Control").match(/no-cache/));
T(xhr.getResponseHeader("Pragma") == "no-cache");
- var currentTime = new Date();
- var expiresHeader = Date.parse(xhr.getResponseHeader("Expires"));
- var dateHeader = Date.parse(xhr.getResponseHeader("Date"));
+ var newetag = xhr.getResponseHeader("ETag");
+ T(etags.indexOf(newetag) < 0);
+ etags[etags.length] = newetag;
+
+ // Removing the time based tests as they break easily when
+ // running CouchDB on a remote server in regards to the browser
+ // running the Futon test suite.
+ //
+ //var currentTime = new Date();
+ //var expiresHeader = Date.parse(xhr.getResponseHeader("Expires"));
+ //var dateHeader = Date.parse(xhr.getResponseHeader("Date"));
- T(expiresHeader < currentTime);
- T(currentTime - dateHeader < 3000);
+ //T(expiresHeader < currentTime);
+ //T(currentTime - dateHeader < 3000);
};
var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});