/* tests.js - unit tests for dommer.js Copyright (C) 2004-2005 Guido Wesdorp email johnny@debris.demon.nl This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: dommer.js,v 1.5 2004/07/31 00:10:15 johnny Exp $ */ function CookieJarTestCase() { this.name = 'CookieJarTestCase'; }; CookieJarTestCase.prototype = new TestCase; CookieJarTestCase.prototype.setUp = function() { this.cookiejar = new cookielib.CookieJar(); }; CookieJarTestCase.prototype.test_everything = function() { this.assertThrows(this.cookiejar.getCookie, this.cookiejar.NoSuchCookie, 'foo'); this.cookiejar.setCookie('foo', 'bar'); this.assertEquals(this.cookiejar.getCookie('foo'), 'bar'); this.cookiejar.delCookie('foo'); this.assertThrows(this.cookiejar.getCookie, this.cookiejar.NoSuchCookie, 'foo'); this.assertThrows(this.cookiejar.delCookie, this.cookiejar.NoSuchCookie, 'foo'); };