Index: tools/testing/architecture.py |
=================================================================== |
--- tools/testing/architecture.py (revision 1427) |
+++ tools/testing/architecture.py (working copy) |
@@ -394,6 +394,37 @@ |
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. |
+ build_root = utils.GetBuildRoot(OS_GUESS, self.mode, 'ia32') |
+ frog = os.path.abspath(os.path.join(build_root, 'frog', 'bin', |
Jennifer Messerly
2011/11/10 23:57:08
TODO: maybe this should run "frogc"?
Emily Fortuna
2011/11/11 00:58:41
What's frogc? Add this as a TODO?
On 2011/11/10 2
Jennifer Messerly
2011/11/11 01:02:32
I think the idea is it's another entry point that
|
+ 'frogsh')) |
Siggi Cherem (dart-lang)
2011/11/11 00:06:02
a more compact way to write the 2 lines above:
fr
|
+ cmd = [frog, '--compile-only', '--out=%s' % self.GetScriptPath()] |
Siggi Cherem (dart-lang)
2011/11/11 00:06:02
you might need to pass --libdir here
Emily Fortuna
2011/11/11 00:58:41
Done.
|
+ 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 +528,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) |