Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py

Issue 61213005: Fix and enable media/track/opera/track/webvtt/parsing-cue-data/* tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: window.prettyPrintDiffs "switch" Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/common.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 import os 3 import os
4 import urllib 4 import urllib
5 import hashlib 5 import hashlib
6 6
7 doctmpl = """<!doctype html> 7 doctmpl = """<!doctype html>
8 <title>WebVTT cue data parser test %s</title> 8 <title>WebVTT cue data parser test {testname}</title>
9 <style>video { display:none }</style> 9 <style>video {{ display:none }}</style>
10 <script src=/../../../resources/testharness.js></script> 10 <script src=../../../../../../../resources/testharness.js></script>
11 <script src=/../../../resources/testharnessreport.js></script> 11 <script src=../../../../../../../resources/testharnessreport.js></script>
12 <script src=/core/standards/html-parsing/html5lib_harness/template.js></script>
13 <script src=/core/standards/html-parsing/html5lib_harness/common.js></script>
14 <script src=../common.js></script> 12 <script src=../common.js></script>
13 <p>WebVTT cue data parser test {testname}</p>
15 <div id=log></div> 14 <div id=log></div>
16 <script> 15 <script>
17 runTests([ 16 runTests([
18 %s 17 {testlist}
19 ]); 18 ]);
20 </script>""" 19 </script>"""
21 20
22 testobj = "{name:'%s', input:'%s', expected:'%s'}" 21 testobj = "{name:'%s', input:'%s', expected:'%s'}"
23 22
24 def appendtest(tests, input, expected): 23 def appendtest(tests, input, expected):
25 tests.append(testobj % (hashlib.sha1(input).hexdigest(), urllib.quote(input[ :-1]), urllib.quote(expected[:-1]))) 24 tests.append(testobj % (hashlib.sha1(input).hexdigest(), urllib.quote(input[ :-1]), urllib.quote(expected[:-1])))
26 25
27 files = os.listdir('dat/') 26 files = os.listdir('dat/')
28 for file in files: 27 for file in files:
(...skipping 27 matching lines...) Expand all
56 input = "" 55 input = ""
57 expected = "" 56 expected = ""
58 state = "" 57 state = ""
59 else: 58 else:
60 expected = expected + line 59 expected = expected + line
61 else: 60 else:
62 raise Exception("failed to parse file "+file+" line:"+line+" (state: "+state+")") 61 raise Exception("failed to parse file "+file+" line:"+line+" (state: "+state+")")
63 f.close() 62 f.close()
64 barename = file.replace(".dat", "") 63 barename = file.replace(".dat", "")
65 out = open('tests/'+barename+".html", "w") 64 out = open('tests/'+barename+".html", "w")
66 out.write(doctmpl % (barename, ",\n".join(tests))) 65 out.write(doctmpl.format(testname=barename, testlist=",\n".join(tests)))
67 out.close() 66 out.close()
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698