|
1 #!/usr/bin/ruby |
|
2 # iExploder - Generates bad HTML files to perform QA for web browsers. |
|
3 # Developed for the Mozilla Foundation. |
|
4 ##################### |
|
5 # |
|
6 # Copyright (c) 2006 Thomas Stromberg <thomas%stromberg.org> |
|
7 # |
|
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. |
|
11 # |
|
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: |
|
15 # |
|
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. |
|
20 # |
|
21 # 2. Altered source versions must be plainly marked as such, and must not be |
|
22 # misrepresented as being the original software. |
|
23 # |
|
24 # 3. This notice may not be removed or altered from any source distribution. |
|
25 |
|
26 require 'cgi'; |
|
27 require 'iexploder'; |
|
28 require 'config'; |
|
29 |
|
30 ### THE INTERACTION ################################## |
|
31 ie = IExploder.new($HTML_MAX_TAGS, $HTML_MAX_ATTRS, $CSS_MAX_PROPS) |
|
32 ie.readTagFiles() |
|
33 |
|
34 cgi = CGI.new("html4"); |
|
35 ie.url=ENV['SCRIPT_NAME'] || '?' |
|
36 ie.test_num = cgi.params['test'][0].to_i |
|
37 ie.subtest_num = cgi.params['subtest'][0].to_i || 0 |
|
38 ie.random_mode = cgi.params['random'][0] |
|
39 ie.lookup_mode = cgi.params['lookup'][0] |
|
40 ie.stop_num = cgi.params['stop'][0].to_i || 0 |
|
41 ie.setRandomSeed |
|
42 |
|
43 cgi.out('type' => 'text/html') do |
|
44 ie.buildPage() |
|
45 end |