ms2ger avatar ms2ger committed b45985e

Backup.

Comments (0)

Files changed (8)

+^\.hg
+^\.mq
+syntax: glob
+status
+guards
+From: Ms2ger <ms2ger@gmail.com>
+
+diff --git a/tests/submission/PhilipTaylor/tools/canvas/gentest.py b/tests/submission/PhilipTaylor/tools/canvas/gentest.py
+--- a/tests/submission/PhilipTaylor/tools/canvas/gentest.py
++++ b/tests/submission/PhilipTaylor/tools/canvas/gentest.py
+@@ -157,16 +157,17 @@ def backref_html(name):
+     c = ''
+     for p in name.split('.')[:-1]:
+         c += '.'+p
+         backrefs.append('<a href="index%s.html">%s</a>.' % (c, p))
+     backrefs.append(name.split('.')[-1])
+     return ''.join(backrefs)
+ 
+ def make_flat_image(filename, w, h, r,g,b,a):
++    return filename
+     if os.path.exists('%s/%s' % (IMAGEOUTPUTDIR, filename)):
+         return filename
+     surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h)
+     cr = cairo.Context(surface)
+     cr.set_source_rgba(r, g, b, a)
+     cr.rectangle(0, 0, w, h)
+     cr.fill()
+     surface.write_to_png('%s/%s' % (IMAGEOUTPUTDIR, filename))
+@@ -381,22 +382,22 @@ for i in range(len(tests)):
+     if 'expected' in test and test['expected'] is not None:
+         expected = test['expected']
+         expected_img = None
+         if expected == 'green':
+             expected_img = make_flat_image('green-100x50.png', 100, 50, 0,1,0,1)
+         elif expected == 'clear':
+             expected_img = make_flat_image('clear-100x50.png', 100, 50, 0,0,0,0)
+         else:
+-            if ';' in expected: print "Found semicolon in %s" % name
++            """if ';' in expected: print "Found semicolon in %s" % name
+             expected = re.sub(r'^size (\d+) (\d+)',
+                 r'surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, \1, \2)\ncr = cairo.Context(surface)',
+                 expected)
+             expected += "\nsurface.write_to_png('%s/%s.png')\n" % (IMAGEOUTPUTDIR, name)
+-            eval(compile(expected, '<test %s>' % test['name'], 'exec'), {}, {'cairo':cairo})
++            eval(compile(expected, '<test %s>' % test['name'], 'exec'), {}, {'cairo':cairo})"""
+             expected_img = "%s.png" % name
+ 
+         if expected_img:
+             expectation_html = ('<p class="output expectedtext">Expected output:' +
+                 '<p><img src="%s" class="output expected" id="expected" alt="">' % (expected_img))
+ 
+     canvas = test.get('canvas', 'width="100" height="50"')
+ 
+From: Ms2ger <ms2ger@gmail.com>
+Revert changes to canvas mochitest template.
+
+diff --git a/tests/submission/PhilipTaylor/tools/canvas/templates.yaml b/tests/submission/PhilipTaylor/tools/canvas/templates.yaml
+--- a/tests/submission/PhilipTaylor/tools/canvas/templates.yaml
++++ b/tests/submission/PhilipTaylor/tools/canvas/templates.yaml
+@@ -108,34 +108,33 @@ w3c: |
+     %(code)s
+ 
+     });
+     </script>
+     %(images)s
+ 
+ mochitest: |
+     <!DOCTYPE HTML>
+-    <title>%(mochi_name_fn)s</title>
++    <title>Canvas test: %(mochi_name)s</title>
+     %(mochi_desc)s<script src="/MochiKit/MochiKit.js"></script>
+     <script src="/tests/SimpleTest/SimpleTest.js"></script>
+     <link rel="stylesheet" href="/tests/SimpleTest/test.css">
+-    %(fonts)s<body><!-- [[[ test_%(mochi_name)s.html ]]] -->
+-
+-    <p>Canvas test: %(mochi_name)s</p>
+-    %(mochi_desc)s%(fonthack)s<canvas id="c" %(canvas)s>%(fallback)s</canvas>
++    %(fonts)s<body>
++    %(fonthack)s<canvas id="c" %(canvas)s>%(fallback)s</canvas>
+     <script>
+-
+-    function %(mochi_name_fn)s() {
++    %(mochi_setup)s
++    SimpleTest.waitForExplicitFinish();
++    MochiKit.DOM.addLoadEvent(function () {
+ 
+     var canvas = document.getElementById('c');
+     var ctx = canvas.getContext('2d');
+ 
+     %(mochi_code)s
+-
+-    }
++    %(mochi_footer)s
++    });
+     </script>
+     %(mochi_images)s
+ 
+ mochitest.isPixel: |
+     function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
+         var pixel = ctx.getImageData(x, y, 1, 1);
+         var pr = pixel.data[0],
+             pg = pixel.data[1],
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.