2 # iExploder - Generates bad HTML files to perform QA for web browsers.
3 # Developed for the Mozilla Foundation.
6 # Copyright (c) 2006 Thomas Stromberg <thomas%stromberg.org>
8 # This software is provided 'as-is', without any express or implied warranty.
9 # In no event will the authors be held liable for any damages arising from the
10 # use of this software.
12 # Permission is granted to anyone to use this software for any purpose,
13 # including commercial applications, and to alter it and redistribute it
14 # freely, subject to the following restrictions:
16 # 1. The origin of this software must not be misrepresented; you must not
17 # claim that you wrote the original software. If you use this software in a
18 # product, an acknowledgment in the product documentation would be appreciated
19 # but is not required.
21 # 2. Altered source versions must be plainly marked as such, and must not be
22 # misrepresented as being the original software.
24 # 3. This notice may not be removed or altered from any source distribution.
31 ### THE INTERACTION ##################################
32 $ie_preload = IExploder.new($HTML_MAX_TAGS, $HTML_MAX_ATTRS, $CSS_MAX_PROPS)
33 $ie_preload.readTagFiles()
34 $ie_preload.url='/iexploder.cgi'
42 puts "* iExploder #{$VERSION} will be available at http://localhost:#{port}"
43 puts "* Max Tags: #$HTML_MAX_TAGS Max Attrs: #$HTML_MAX_ATTRS Max Props: #$CSS_MAX_PROPS"
46 s = HTTPServer.new( :Port => port )
47 class IEServlet < HTTPServlet::AbstractServlet
50 ie.test_num = req.query['test'].to_i
51 ie.subtest_num = req.query['subtest'].to_i || 0
52 ie.random_mode = req.query['random']
53 ie.lookup_mode = req.query['lookup']
54 ie.stop_num = req.query['stop'].to_i
57 res['Content-Type'] = 'text/html'
58 res.body = ie.buildPage()
62 class IEForm < HTTPServlet::AbstractServlet
64 res['Content-Type'] = 'text/html'
65 res.body = File.open("index.html").readlines.join("\n")
71 s.mount("/iexploder.cgi", IEServlet)
73 trap("INT") { s.shutdown }