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

Unified Diff: samples/third_party/dromaeo/generate_perf_and_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
« no previous file with comments | « samples/third_party/dromaeo/generate_dart2js_tests.py ('k') | samples/third_party/dromaeo/htmlrunner.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/third_party/dromaeo/generate_perf_and_dart2js_tests.py
diff --git a/samples/third_party/dromaeo/generate_dart2js_tests.py b/samples/third_party/dromaeo/generate_perf_and_dart2js_tests.py
similarity index 71%
rename from samples/third_party/dromaeo/generate_dart2js_tests.py
rename to samples/third_party/dromaeo/generate_perf_and_dart2js_tests.py
index 800eaabcb4d6dde9ebb7d9e73ff5fd031a574fb0..b3e762ebcf8ef5c79588ec840f0589c460dabe8a 100755
--- a/samples/third_party/dromaeo/generate_dart2js_tests.py
+++ b/samples/third_party/dromaeo/generate_perf_and_dart2js_tests.py
@@ -8,6 +8,10 @@ import re
import subprocess
import sys
+# Compile the Dart dromaeo test down to JavaScript, and also insert two scripts
+# that enable us to run this test as a browser test with the Dart browser
+# controller.
+
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')
@@ -15,13 +19,8 @@ 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]
+ executable = 'dart2js'
binary = os.path.abspath(os.path.join(DART_PATH,
utils.GetBuildRoot(utils.GuessOS(),
'release', 'ia32'),
@@ -76,5 +75,17 @@ tests = glob.glob('tests/dom-*-html.html')
for test in tests:
HtmlConvert(test, 'dart2js')
+# Update index.html to run as a performance test with the dart browser
+# controller. Output the result as index-dart.html.
+with open('index.html', 'r') as infile:
+ with open('index-dart.html', 'w') as outfile:
+ for line in infile:
+ if re.search('<script src="../../../pkg/browser/lib/dart.js">', line):
+ line += (' <script src="../../../tools/testing/dart/test_controller' +
+ '.js"></script>\n <script src="../../../tools/testing/dart/' +
+ 'perf_test_controller.js"></script>\n')
+ outfile.write(line)
+
# Compile driver to index-js.html.
-HtmlConvert('index.html', 'dart2js')
+HtmlConvert('index-dart.html', 'dart2js')
+os.rename('index-dart-js.html', 'index-js.html')
« no previous file with comments | « samples/third_party/dromaeo/generate_dart2js_tests.py ('k') | samples/third_party/dromaeo/htmlrunner.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698