[icedtea-web][rfc] Reproducer for PR588, java cookie jar cookies being stored properly

Jiri Vanek jvanek at redhat.com
Fri Jul 27 03:26:15 PDT 2012


On 07/26/2012 09:34 PM, Adam Domurad wrote:
> So Java has an internal cookie store that should be synchronized with
> the browser cookies. This reproducer tests if an applet on one page can
> read the cookies that an applet on another page sets.

Hi!

Thank you for test. I have however several conceptional hints.
First of all - the test is not passing in any browser - with or without your patch:((

You are using  -  getAppletContext().showDocument... - this function was never tested in automated 
testsuites. Before inclusion in tests of something else, please prepare reproducer for this function 
itself. In this be sure you are testing both getAppletContext().showDocument(string) and 
getAppletContext().showDocument(string1, string2) -  for second one be sure t test all possibilites 
of string2. Imho I blame this function (maybe because used in init) from failure of tests more then 
your cookies approach/testing.

Your approach of testing temporary cookies (showDocument)is very interesting and I'm glad you have 
used it, and I would like to keep it also with other tests I'm suggesting below.

You are doing all the stuff in init. Although it is very good to have those tested in init, I would 
suggest to do the logic in start more likely.

The verbose output of reproducers itself can be more verbose  (eg "Cokokie map read" and "Cookies 
headers put"). This is really nitpick, but it can help you during synchronization (see lower).

As far as I read it, you had to launch two applets in queue in one browser without closing. Usage of 
showDocument was really nice hack :) But there is more correct approach - you can launch browser 
(in testcase) in separate thread. Wait until applet inside is initialized and then launch your 
prime-to-be-tested applet in main thread and evaluate (both if you want). There are already 
reproducers with this approach. (They are using ContentReaderListeners, but you can use your own 
approach).
Also you can test that without launch of savingcookies.class the checkcookie.java will fail (in that 
case it will be pass of test)

Also as far as i understand you are testing just temporary cookies in browser. I would appreciate 
also persistent cookies and both cookies behaviour without browser (in javaws) if relevant.

I'm sorry for adding more work to you, but current approach alone give me just small sense:(

Sumamry:

* Move more logic to start
* test showDocument separately (please reuse as much as possible!) (also ensure ignoration if 
launched in javaws)
* extend cookie tests: by synchronizes browsers,  or persistent cookies and for javaws and for cases 
with expected failure)
* double above with init tests (but be avare where it is failure of icedtea-web and where irrelevant 
usage of init) where relevant
* do not send me pigeon with explosives

Thank you in advice.

I'm reviewing also your patch code but C part gives me  (well deserved!) headaches o give me some time.


Best regard
   J.




More information about the distro-pkg-dev mailing list