load-error-events.py (483B)
1 import re 2 3 def main(request, response): 4 headers = [(b"Content-Type", b"text/javascript")] 5 test = request.GET.first(b'test') 6 assert(re.match(b'^[a-zA-Z0-9_]+$', test)) 7 8 if test.find(b'_load') >= 0: 9 status = 200 10 content = b'"use strict"; %s.executed = true;' % test 11 else: 12 status = 404 13 content = b'"use strict"; %s.test.step(function() { assert_unreached("404 script should not be executed"); });' % test 14 15 return status, headers, content