From: <bra...@us...> - 2008-12-05 22:20:38
|
Revision: 2645 http://archive-access.svn.sourceforge.net/archive-access/?rev=2645&view=rev Author: bradtofel Date: 2008-12-05 22:20:33 +0000 (Fri, 05 Dec 2008) Log Message: ----------- Fixed bad tests of style rewrites -- we were only testing one of the two CSS rewrite ops at a time, when both were being applied within HTML pages, this was causing some URLs to be rewritten twice, but these tests didn't catch that. Now they do both rewrites, which works now since URIConverter ops are now idempotent. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/replay/TagMagixTest.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/replay/TagMagixTest.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/replay/TagMagixTest.java 2008-12-05 22:17:55 UTC (rev 2644) +++ trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/replay/TagMagixTest.java 2008-12-05 22:20:33 UTC (rev 2645) @@ -423,6 +423,13 @@ // "<table style=\"bg: url(\\\"http://w.a.org/wb/2004/http://f.au/css/b.gif\\\"); fg: url(\\\"http://w.a.org/wb/2004/http://f.au/css/f.gif\\\");\"></table>", // "http://w.a.org/wb/","2004","http://f.au/"); + + checkStyleUrlMarkup("<td style=\"b-i:url(i/b.jpg);\n\"></td>", + "<td style=\"b-i:url(http://w.a.org/wb/2004/http://f.au/i/b.jpg);\n\"></td>", + "http://w.a.org/wb/","2004","http://f.au/"); + +// "<td style=\"background-image:url(images/banner.jpg);\n\"></td>" + } @@ -449,11 +456,12 @@ ArchivalUrlResultURIConverter uriC = new ArchivalUrlResultURIConverter(); uriC.setReplayURIPrefix(prefix); TagMagix.markupCSSImports(buf, uriC, ts, url); + TagMagix.markupStyleUrls(buf,uriC,ts,url); String marked = buf.toString(); assertEquals(want,marked); } - private void checkStyleUrlMarkup(String orig, String want, String prefix, String ts, String url) { + private void checkStyleOnlyUrlMarkup(String orig, String want, String prefix, String ts, String url) { StringBuilder buf = new StringBuilder(orig); ArchivalUrlResultURIConverter uriC = new ArchivalUrlResultURIConverter(); uriC.setReplayURIPrefix(prefix); @@ -461,6 +469,16 @@ String marked = buf.toString(); assertEquals(want,marked); } + + private void checkStyleUrlMarkup(String orig, String want,String prefix, String ts, String url) { + StringBuilder buf = new StringBuilder(orig); + ArchivalUrlResultURIConverter uriC = new ArchivalUrlResultURIConverter(); + uriC.setReplayURIPrefix(prefix); + TagMagix.markupCSSImports(buf, uriC, ts, url); + TagMagix.markupStyleUrls(buf, uriC, ts, url); + String marked = buf.toString(); + assertEquals(want,marked); + } private void checkMarkup(String orig, String want, String tag, String attr, String prefix, String ts, String url) { StringBuilder buf = new StringBuilder(orig); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |