| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 """Unit tests for update_webgl_conformance_tests.""" | 29 """Unit tests for update_webgl_conformance_tests.""" |
| 30 | 30 |
| 31 import webkitpy.thirdparty.unittest2 as unittest | 31 import unittest |
| 32 |
| 32 from webkitpy.webgl import update_webgl_conformance_tests as webgl | 33 from webkitpy.webgl import update_webgl_conformance_tests as webgl |
| 33 | 34 |
| 34 | 35 |
| 35 def construct_script(name): | 36 def construct_script(name): |
| 36 return "<script src=\"" + name + "\"></script>\n" | 37 return "<script src=\"" + name + "\"></script>\n" |
| 37 | 38 |
| 38 | 39 |
| 39 def construct_style(name): | 40 def construct_style(name): |
| 40 return "<link rel=\"stylesheet\" href=\"" + name + "\">" | 41 return "<link rel=\"stylesheet\" href=\"" + name + "\">" |
| 41 | 42 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 output_text += construct_style(output if output else input) | 89 output_text += construct_style(output if output else input) |
| 89 for input, output in scripts.items(): | 90 for input, output in scripts.items(): |
| 90 input_text += construct_script(input) | 91 input_text += construct_script(input) |
| 91 output_text += construct_script(output if output else input) | 92 output_text += construct_script(output if output else input) |
| 92 | 93 |
| 93 head = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">\n<html>\n<head>\n
' | 94 head = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">\n<html>\n<head>\n
' |
| 94 foot = '</head>\n<body>\n</body>\n</html>' | 95 foot = '</head>\n<body>\n</body>\n</html>' |
| 95 input_text = head + input_text + foot | 96 input_text = head + input_text + foot |
| 96 output_text = head + output_text + foot | 97 output_text = head + output_text + foot |
| 97 self.assert_translate(input_text, output_text) | 98 self.assert_translate(input_text, output_text) |
| OLD | NEW |