14 Commits
Author SHA1 Message Date
Marek Safar af11f84af0 [system] Cookies implementation from reference sources 2015-01-14 16:41:27 +01:00
Alexander Köplinger e50764ba04 Fix CookieContainerTest to use expiration date in the future
It is 2015 now, so the cookie is already expired and the test fails otherwise.
2015-01-02 16:54:22 +01:00
Marek Safar f0ad346fb6 Mobile tests update 2013-02-22 21:41:19 +01:00
Martin Baulig cabf7d1f13 Fixed and improved Mono's Cookie implementation.
* Updated the tests to reflect .NET 4.5's new improved behavior.
* Fixed subdomain matching rules.
* Added some very simple sanity checks, such as same origin and
  public suffixes.

This is far from perfect, but the tests now pass with .NET 4.5
and this also fixes a Monotouch bug from one of our customers.

TODO:

* Using 'Cookie.Version = 1' (RFC 2109 compliance) apparently got
  broken in .NET 4.5; I disabled the corresponding tests / made
  them use the default 'Version = 0' where possible.

* Same origin has not been tested for security (it previously
  didn't exist at all) and we should probably use the list at
  publicsuffix.org; but .NET 4.5 also allows you to set a cookie
  .co.uk (haven't tested their web stack, thoug - it's possible
  that they have additional checks there).
2012-09-13 02:00:56 +02:00
Jeremie Laval 91fed5ca46 [System] Try to fix Cookies tests
The first part was to try to repro the ordering behavior of MS which seems to be based on the string length of, first, the domain and, then, the path.
Second part was to fix the .local unit test with Dns.GetHostname as some OS (namely Mac) append a '.local' by default to the hostname.
2012-05-31 13:43:06 +01:00
Marek Safar d4f6c46e62 Fix setting cookie port from uri 2012-04-24 18:12:36 +01:00
Marek Safar 3462f4b981 Remove NET_2_0 2011-12-07 18:34:26 +00:00
Sebastien Pouliot 1cc8e885d5 In Test/System.Net:
2010-01-21  Sebastien Pouliot  <[email protected]>

	* CookieContainerTest.cs: Additional test cases from Tom Philpot

In System.Net:
2010-01-21  Sebastien Pouliot  <[email protected]>

	* CookieContainer.cs: Fix to cloning and expiration. Patch
	by Tom Philpot <[email protected]>


svn path=/trunk/mcs/; revision=149976
2010-01-21 15:02:51 +00:00
Sebastien Pouliot 4a1a02cb04 In Test/System.Net:
2009-12-24  Sebastien Pouliot  <[email protected]>

	* CookieContainerTest.cs: Split many tests into smaller test 
	cases. Add test cases for DefaultPerDomainCookieLimit and
	DefaultCookieLimit. Remove all [Category ("NotWorking")] since
	everything works now.

In System.Net:
2009-12-24  Sebastien Pouliot  <[email protected]>

	* Cookie.cs: Re-work ToString to be useable in more cases. Fix
	some issues found by Gendarme.
	* CookieContainer.cs: Fix all NonWorking (and new) unit tests.
	Implement removing oldest cookies when limits are reached.
	* CookieCollection.cs: Move to generics internally. Fix sort to 
	be closer to MS implementation (but still not 100% identical).
	Fix some issues found by Gendarme.


svn path=/trunk/mcs/; revision=148891
2009-12-24 15:24:13 +00:00
Gert Driesen ae22b8dbe3 * CookieContainer.cs: Provide meaningful information in exception
messages, and improve compatibility with MS. Modified set_Capacity to
no longer change MaxCookieSize when new value is less than
MaxCookieSize.
* CookieTest.cs: Added test for Path.
* CookieContainerTest.cs: Added and improved .ctor tests.
Improved tests for Capacity and MaxCookieSize. Added tests for
PerDomainCapacity. Added tests for Add overloads, GetCookieHeader,
GetCookies and SetCookies. Added test for bug #421827.

svn path=/trunk/mcs/; revision=134295
2009-05-17 15:06:17 +00:00
Daniel Nauck 1533e98656 2008-02-09 Daniel Nauck <[email protected]>
* CookieContainerTest.cs: added some not working Add/Expired tests


svn path=/trunk/mcs/; revision=95332
2008-02-09 13:30:33 +00:00
Marek Habersack da4429171a 2007-04-23 Marek Habersack <[email protected]>
* CookieContainerTest.cs: the GetCookies test works now.

2007-04-23  Marek Habersack  <[email protected]>

	* CookieContainer.cs: Sort the collection by the path relevance before returning from
	the GetCookies method. Fixes bug #81421.

svn path=/trunk/mcs/; revision=76101
2007-04-23 09:49:08 +00:00
Gert Driesen e291e13d3a * CookieContainerTest.cs: Removed usage of deprecated Asssertion
class. Added test for bug #81421.

svn path=/trunk/mcs/; revision=76063
2007-04-22 16:01:17 +00:00
Gonzalo Paniagua Javier c46bb06223 2004-12-01 Gonzalo Paniagua Javier <[email protected]>
* Test/System.Net/CookieContainerTest.cs: added tests for
	CookieContainer.

	* System.Net/CookieContainer.cs: style, fixed checks for properties,
	implemented the MonoTODOs for the method that take an Uri. GetCookies
	and GetCookieHeaders now really return only the cookies that are
	requested filtering by the Uri parameter.

	* System.Net/Cookie.cs: style, added default values for Comment, Domain
	and Port.

	* System_test.dll.sources: added CookieContainerTest.cs.


svn path=/trunk/mcs/; revision=36918
2004-12-01 23:27:23 +00:00