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

Unified Diff: tools/testing/architecture.py

Issue 8469016: Adding in-browser correctness testing via selenium. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: tools/testing/architecture.py
===================================================================
--- tools/testing/architecture.py (revision 1427)
+++ tools/testing/architecture.py (working copy)
@@ -394,6 +394,38 @@
return 0
+class WebDriverArchiecture(ChromiumArchitecture):
+ """Architecture that runs compiled dart->JS (via frog) through a variety of
+ real browsers using WebDriver."""
+
+ def __init__(self, root_path, arch, mode, component, test):
+ super(WebDriverArchiecture, self).__init__(root_path, arch, mode,
+ component, test)
+
+ def GetCompileCommand(self, fatal_static_type_errors=False):
+ """Returns cmdline as an array to invoke the compiler on this test."""
+ # We need an absolute path because the compilation will run
+ # in a temporary directory.
+ frog = os.path.abspath(utils.GetDartRunner(self.mode, self.arch, 'frogsh'))
ngeoffray 2011/11/11 09:20:50 Could that be frog instead? frogsh requires node,
+ build_root = utils.GetBuildRoot(OS_GUESS, self.mode, 'ia32')
+ cmd = [frog, '--libdir=%s' % os.path.abspath(os.path.join(self.root_path,
+ 'frog', 'lib')), '--compile-only',
+ '--out=%s' % self.GetScriptPath()]
+ cmd.append(self.GetTestScriptFile())
+ return cmd
+
+ def GetRunCommand(self, fatal_static_type_errors=False):
+ """Returns a command line to execute for the test."""
+ selenium_location = os.path.join(self.root_path, 'tools', 'testing',
+ 'run_selenium.py')
+
+ html_output_file = os.path.join(self.GetHtmlPath(), self.GetHtmlName())
+ f = open(html_output_file, 'w')
+ f.write(self.GetHtmlContents())
+ f.close()
+ return [selenium_location, html_output_file]
+
+
class StandaloneArchitecture(Architecture):
"""Base class for architectures that run tests without a browser."""
@@ -497,6 +529,9 @@
elif component == 'dartium':
return DartiumArchitecture(root_path, arch, mode, component, test)
+ elif component == 'webdriver':
+ return WebDriverArchiecture(root_path, arch, mode, component, test)
+
elif component in ['vm', 'frog', 'frogsh']:
return StandaloneArchitecture(root_path, arch, mode, component, test)
« no previous file with comments | « tools/test.py ('k') | tools/testing/run_selenium.py » ('j') | tools/testing/run_selenium.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698