Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 73829 invoked from network); 25 Aug 2010 08:57:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Aug 2010 08:57:40 -0000 Received: (qmail 81955 invoked by uid 500); 25 Aug 2010 08:57:40 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 81820 invoked by uid 500); 25 Aug 2010 08:57:37 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 81813 invoked by uid 99); 25 Aug 2010 08:57:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Aug 2010 08:57:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Aug 2010 08:57:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CB8F223889EA; Wed, 25 Aug 2010 08:56:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r988909 - in /couchdb/trunk/share/www/script: couch_test_runner.js test/attachments.js Date: Wed, 25 Aug 2010 08:56:15 -0000 To: commits@couchdb.apache.org From: rnewson@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100825085615.CB8F223889EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rnewson Date: Wed Aug 25 08:56:15 2010 New Revision: 988909 URL: http://svn.apache.org/viewvc?rev=988909&view=rev Log: fix attachments.js in Safari by treating charset case-insensitively. Modified: couchdb/trunk/share/www/script/couch_test_runner.js couchdb/trunk/share/www/script/test/attachments.js Modified: couchdb/trunk/share/www/script/couch_test_runner.js URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/couch_test_runner.js?rev=988909&r1=988908&r2=988909&view=diff ============================================================================== --- couchdb/trunk/share/www/script/couch_test_runner.js (original) +++ couchdb/trunk/share/www/script/couch_test_runner.js Wed Aug 25 08:56:15 2010 @@ -311,6 +311,11 @@ function TEquals(expected, actual, testN "', got '" + repr(actual) + "'", testName); } +function TEqualsIgnoreCase(expected, actual, testName) { + T(equals(expected.toUpperCase(), actual.toUpperCase()), "expected '" + repr(expected) + + "', got '" + repr(actual) + "'", testName); +} + function equals(a,b) { if (a === b) return true; try { Modified: couchdb/trunk/share/www/script/test/attachments.js URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/attachments.js?rev=988909&r1=988908&r2=988909&view=diff ============================================================================== --- couchdb/trunk/share/www/script/test/attachments.js (original) +++ couchdb/trunk/share/www/script/test/attachments.js Wed Aug 25 08:56:15 2010 @@ -68,12 +68,12 @@ couchTests.attachments= function(debug) T(binAttDoc2._attachments["foo.txt"] !== undefined); T(binAttDoc2._attachments["foo2.txt"] !== undefined); - T(binAttDoc2._attachments["foo2.txt"].content_type == "text/plain;charset=utf-8"); + TEqualsIgnoreCase("text/plain;charset=utf-8", binAttDoc2._attachments["foo2.txt"].content_type); T(binAttDoc2._attachments["foo2.txt"].length == 30); var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc2/foo2.txt"); T(xhr.responseText == "This is no base64 encoded text"); - T(xhr.getResponseHeader("Content-Type") == "text/plain;charset=utf-8"); + TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type")); // test without rev, should fail var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc2/foo2.txt"); @@ -97,7 +97,7 @@ couchTests.attachments= function(debug) var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt"); T(xhr.responseText == bin_data); - T(xhr.getResponseHeader("Content-Type") == "text/plain;charset=utf-8"); + TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type")); var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt", { headers:{"Content-Type":"text/plain;charset=utf-8"}, @@ -115,11 +115,11 @@ couchTests.attachments= function(debug) var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt"); T(xhr.responseText == bin_data); - T(xhr.getResponseHeader("Content-Type") == "text/plain;charset=utf-8"); + TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type")); var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev); T(xhr.responseText == bin_data); - T(xhr.getResponseHeader("Content-Type") == "text/plain;charset=utf-8"); + TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type")); var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev); T(xhr.status == 200); @@ -131,7 +131,7 @@ couchTests.attachments= function(debug) var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev); T(xhr.status == 200); T(xhr.responseText == bin_data); - T(xhr.getResponseHeader("Content-Type") == "text/plain;charset=utf-8"); + TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type")); // empty attachments var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc4/attachment.txt", { @@ -212,7 +212,7 @@ couchTests.attachments= function(debug) var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt"); T(xhr.responseText == lorem); - T(xhr.getResponseHeader("Content-Type") == "text/plain;charset=utf-8"); + TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type")); // test large inline attachment too var lorem_b64 = CouchDB.request("GET", "/_utils/script/test/lorem_b64.txt").responseText;