From: Fabian Keil Date: Tue, 19 Jan 2021 17:54:50 +0000 (+0100) Subject: Add test scenario content-filters X-Git-Url: http://www.privoxy.org/gitweb/templates.html?p=privoxy.git;a=commitdiff_plain;h=1773ba22356d917738727dc1d530ac7e6de73fa6 Add test scenario content-filters Sponsored by: Privoxy project funds collected at SPI --- diff --git a/tests/cts/content-filters/content-filters.action b/tests/cts/content-filters/content-filters.action new file mode 100644 index 00000000..25de2530 --- /dev/null +++ b/tests/cts/content-filters/content-filters.action @@ -0,0 +1,95 @@ +{+filter{js-annoyances}} +/js-annoyances/ + +{+filter{js-events}} +/js-events/ + +{+filter{html-annoyances}} +/html-annoyances/ + +{+filter{content-cookies}} +/content-cookies/ + +{+filter{refresh-tags}} +/refresh-tags/ + +{+filter{unsolicited-popups}} +/unsolicited-popups/ + +{+filter{all-popups}} +/all-popups/ + +{+filter{img-reorder}} +/img-reorder/ + +{+filter{banners-by-size}} +/banners-by-size/ + +{+filter{banners-by-link}} +/banners-by-link/ + +{+filter{webbugs}} +/webbugs/ + +{+filter{tiny-textforms}} +/tiny-textforms/ + +{+filter{jumping-windows}} +/jumping-windows/ + +{+filter{frameset-borders}} +/frameset-borders/ + +{+filter{iframes}} +/iframes/ + +{+filter{demoronizer}} +/demoronizer/ + +{+filter{shockwave-flash}} +/shockwave-flash/ + +{+filter{quicktime-kioskmode}} +/quicktime-kioskmode/ + +{+filter{fun}} +/fun/ + +{+filter{crude-parental}} +/crude-parental/ + +{+filter{ie-exploits}} +/ie-exploits/ + +{+filter{site-specifics}} +/site-specifics/ + +{+filter{no-ping}} +/no-ping/ + +{+filter{allow-autocompletion}} +/allow-autocompletion/ + +{+filter{github}} +/github/ + +{+filter{imdb}} +/imdb/ + +{+filter{google}} +/google/ + +{+filter{google}} +/google/ + +{+filter{yahoo}} +/yahoo/ + +{+filter{msn}} +/msn/ + +{+filter{blogspot}} +/blogspot/ + +{+filter{sourceforge}} +/sourceforge/ diff --git a/tests/cts/content-filters/data/test1 b/tests/cts/content-filters/data/test1 new file mode 100644 index 00000000..e9713072 --- /dev/null +++ b/tests/cts/content-filters/data/test1 @@ -0,0 +1,229 @@ + + + +HTTP +HTTP GET +filter js-annoyances + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the js-annoyances filter should modify: + +# pcrs command 1: + +blafasel.referrer + +# pcrs command 2: + +bla bla bla this.defaultstatus = "hoho" x y z +bla bla bla window.status = "whatever" x y z + +# pcrs command 3: + +this.status = blafasel; +window.defaultstatus= dieda; + +# pcrs command 4: + + + +# pcrs command 5: + + + +# pcrs command 6: + +open (blafasel resizable="yes"); +open(blafasel resizable='yes'); + +# pcrs command 7: + +open(blafasel location="yes") +open(blafasel location='yes') + +# pcrs command 8: + +open(blafasel status="yes") +open(blafasel status='yes') + +# pcrs command 9: + +open(blafasel scrolling="auto") +open(blafasel scrollbars='auto') + +# pcrs command 10: + +open(blafasel menubar="yes") +open(blafasel menubar='yes') + +# pcrs command 11: + +open(blafasel toolbar="yes") +open(blafasel toolbar='yes') + +# pcrs command 12: + +open(blafasel directories="yes") +open(blafasel directories='yes') + +# pcrs command 13: + +open(blafasel fullscreen="no") +open(blafasel fullscreen='0') + +# pcrs command 14: + +open(blafasel alwaysraised="no") +open(blafasel alwayslowered='no') + +# pcrs command 15: + +open(blafasel z-lock="no") +open(blafasel zlock='no') + +# pcrs command 16: + +open(blafasel hotkeys="no") +open(blafasel hotkeys='no') + +# pcrs command 17: + +open(blafasel titlebar="yes") +open(blafasel titlebar='yes') + + + + + + +http + + ++filter{js-annoyances} + + +proxy + + +http://%HOSTIP:%HTTPPORT/js-annoyances/%TESTNUMBER + + + + + +GET /js-annoyances/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + + + + diff --git a/tests/cts/content-filters/data/test10 b/tests/cts/content-filters/data/test10 new file mode 100644 index 00000000..e5c35643 --- /dev/null +++ b/tests/cts/content-filters/data/test10 @@ -0,0 +1,108 @@ + + + +HTTP +HTTP GET +filter banners-by-link + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here is some HTML that the banners-by-link filter should modify: + +# pcrs command 1: + + + + + + + + + + + +# pcrs command 2: + + + + + + + + + + + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 3256 + +# Here is some HTML that the banners-by-link filter should modify: + +# pcrs command 1: + + + + + + + + + + + +# pcrs command 2: + + + + + + + + + + + + + + + +http + + ++filter{banners-by-link} + + +proxy + + +http://%HOSTIP:%HTTPPORT/banners-by-link/%TESTNUMBER + + + + + +GET /banners-by-link/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + + + + diff --git a/tests/cts/content-filters/data/test11 b/tests/cts/content-filters/data/test11 new file mode 100644 index 00000000..277ea886 --- /dev/null +++ b/tests/cts/content-filters/data/test11 @@ -0,0 +1,102 @@ + + + +HTTP +HTTP GET +filter webbugs + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here is some HTML that the webbugs filter should squash: + + + + + + + + + + + + + + + + + + + + + + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 80 + +# Here is some HTML that the webbugs filter should squash: + + + + + + + + + + + + + + + + + + + + + + + + + + +http + + ++filter{webbugs} + + +proxy + + +http://%HOSTIP:%HTTPPORT/webbugs/%TESTNUMBER + + + + + +GET /webbugs/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + + + + diff --git a/tests/cts/content-filters/data/test12 b/tests/cts/content-filters/data/test12 new file mode 100644 index 00000000..a7a7fd65 --- /dev/null +++ b/tests/cts/content-filters/data/test12 @@ -0,0 +1,92 @@ + + + +HTTP +HTTP GET +filter tiny-textforms + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some tiny textforms the tiny-textforms filter should filter: + +# pcrs command 1: + +