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

Unified Diff: samples/third_party/dromaeo/generate_dart2js_tests.py

Issue 178223008: Replace run_selenium.py with Dart script that uses the browser controller for performance tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: samples/third_party/dromaeo/generate_dart2js_tests.py
diff --git a/samples/third_party/dromaeo/generate_dart2js_tests.py b/samples/third_party/dromaeo/generate_dart2js_tests.py
deleted file mode 100755
index 800eaabcb4d6dde9ebb7d9e73ff5fd031a574fb0..0000000000000000000000000000000000000000
--- a/samples/third_party/dromaeo/generate_dart2js_tests.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/python
-
-import glob
-import os
-import os.path
-import platform
-import re
-import subprocess
-import sys
-
-SAMPLES_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-DART_PATH = os.path.dirname(SAMPLES_PATH)
-TOOLS_PATH = os.path.join(DART_PATH, 'tools')
-
-sys.path.append(TOOLS_PATH)
-import utils
-
-EXECUTABLE_MAP = {
- 'frog': 'frogc',
- 'dart2js': 'dart2js'
-}
-
-def Compile(source, target, compiler):
- executable = EXECUTABLE_MAP[compiler]
- binary = os.path.abspath(os.path.join(DART_PATH,
- utils.GetBuildRoot(utils.GuessOS(),
- 'release', 'ia32'),
- 'dart-sdk', 'bin', executable))
-
- cmd = [binary, '--out=' + target]
- cmd.append(source)
- print 'Executing: ' + ' '.join(cmd)
- if platform.system() == "Windows":
- subprocess.call(cmd, shell=True)
- else:
- subprocess.call(cmd)
-
-def HtmlConvert(infile, compiler):
- (head, tail) = os.path.split(infile)
-
- if head == 'tests':
- outdir = compiler
- os.chdir('tests')
- if not os.path.exists(outdir):
- os.makedirs(outdir)
- elif head == '':
- outdir = '.'
- else:
- raise 'Illegal input: ' + infile
-
- pattern = r'<script type="application/dart" src="([\w-]+).dart">'
- infile = open(tail, 'r')
- outfilename = os.path.join(outdir, tail.replace('.html', '-js.html'))
- outfile = open(outfilename, 'w')
-
- print 'Converting %s to %s' % (tail, outfilename)
- for line in infile:
- result = re.search(pattern, line)
- if result:
- testname = result.group(1)
- dartname = testname + '.dart'
- jsname = '%s.%s.js' % (testname, compiler)
- outname = os.path.join(outdir, jsname)
- Compile(dartname, outname, compiler)
- script = '<script type="text/javascript" src="%s" defer>' % jsname
- outfile.write(re.sub(pattern, script, line))
- else:
- outfile.write(line)
-
- if head == 'tests':
- os.chdir('..')
-
-# Compile individual html tests.
-tests = glob.glob('tests/dom-*-html.html')
-
-for test in tests:
- HtmlConvert(test, 'dart2js')
-
-# Compile driver to index-js.html.
-HtmlConvert('index.html', 'dart2js')
« no previous file with comments | « samples/third_party/dromaeo/dromaeo_end_condition.js ('k') | samples/third_party/dromaeo/generate_perf_and_dart2js_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698