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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/encrypted-media/polyfill/make-polyfill-tests.py

Issue 2546853003: Add W3C encrypted-media tests (Closed)
Patch Set: rebase now that content files landed Created 4 years 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
OLDNEW
(Empty)
1 #!/usr/bin/python
2 import os, re, os.path, glob
3
4 head = re.compile( r"^(\s*</head>)", re.MULTILINE )
5 runtest = re.compile( r"runTest\(\s*(\S.*?)\s*\)", re.DOTALL )
6
7 scripts = '''
8 <!-- Polyfill files (NOTE: These are added by auto-generation script) -->
9 <script src=/encrypted-media/polyfill/chrome-polyfill.js></script>
10 <script src=/encrypted-media/polyfill/firefox-polyfill.js></script>
11 <script src=/encrypted-media/polyfill/edge-persistent-usage-record.js></scri pt>
12 <script src=/encrypted-media/polyfill/edge-keystatuses.js></script>
13 <script src=/encrypted-media/polyfill/clearkey-polyfill.js></script>'''
14
15 def process_file( infile, outfile ) :
16 with open( outfile, "w" ) as output :
17 with open( infile, "r" ) as input :
18 output.write( runtest.sub( r"runTest( \1, 'polyfill: ' )", head.sub( scripts + r"\1", input.read() ) ) )
19
20 if __name__ == '__main__' :
21 if (not os.getcwd().endswith('polyfill')) :
22 print "Please run from polyfill directory"
23 exit( 1 )
24
25 for infile in glob.glob( "../*.html" ) :
26 process_file( infile, os.path.basename( infile ) )
27
28 for infile in glob.glob( "../resources/*.html" ) :
29 process_file( infile, os.path.join( "resources", os.path.basename( infil e ) ) )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698