OLD | NEW |
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 # | 4 # |
5 | 5 |
6 import os | 6 import os |
7 import platform | 7 import platform |
8 import re | 8 import re |
9 import shutil | 9 import shutil |
10 import subprocess | 10 import subprocess |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 return path + '.dartium.html' | 418 return path + '.dartium.html' |
419 | 419 |
420 def GetCompileCommand(self, fatal_static_type_errors=False): | 420 def GetCompileCommand(self, fatal_static_type_errors=False): |
421 fatal_static_type_errors = fatal_static_type_errors # shutup lint! | 421 fatal_static_type_errors = fatal_static_type_errors # shutup lint! |
422 return None | 422 return None |
423 | 423 |
424 def Compile(self): | 424 def Compile(self): |
425 return 0 | 425 return 0 |
426 | 426 |
427 | 427 |
428 class WebDriverArchiecture(FrogChromiumArchitecture): | 428 class WebDriverArchitecture(FrogChromiumArchitecture): |
429 """Architecture that runs compiled dart->JS (via frog) through a variety of | 429 """Architecture that runs compiled dart->JS (via frog) through a variety of |
430 real browsers using WebDriver.""" | 430 real browsers using WebDriver.""" |
431 | 431 |
432 def __init__(self, root_path, arch, mode, component, test): | 432 def __init__(self, root_path, arch, mode, component, test): |
433 super(WebDriverArchiecture, self).__init__(root_path, arch, mode, | 433 super(WebDriverArchitecture, self).__init__(root_path, arch, mode, |
434 component, test) | 434 component, test) |
435 | 435 |
436 def GetRunCommand(self, fatal_static_type_errors=False): | 436 def GetRunCommand(self, fatal_static_type_errors=False): |
437 """Returns a command line to execute for the test.""" | 437 """Returns a command line to execute for the test.""" |
| 438 flags = self.vm_options |
| 439 browser_flag = 'chrome' |
| 440 if 'ff' in flags or 'firefox' in flags: |
| 441 browser_flag = 'ff' |
| 442 elif 'ie' in flags or 'explorer' in flags or 'internet-explorer' in flags: |
| 443 browser_flag = 'ie' |
| 444 |
438 selenium_location = os.path.join(self.root_path, 'tools', 'testing', | 445 selenium_location = os.path.join(self.root_path, 'tools', 'testing', |
439 'run_selenium.py') | 446 'run_selenium.py') |
440 | 447 |
441 html_output_file = os.path.join(self.GetHtmlPath(), self.GetHtmlName()) | 448 html_output_file = os.path.join(self.GetHtmlPath(), self.GetHtmlName()) |
442 f = open(html_output_file, 'w') | 449 f = open(html_output_file, 'w') |
443 f.write(self.GetHtmlContents()) | 450 f.write(self.GetHtmlContents()) |
444 f.close() | 451 f.close() |
445 return [selenium_location, html_output_file] | 452 return [selenium_location, html_output_file, browser_flag] |
446 | 453 |
447 | 454 |
448 class StandaloneArchitecture(Architecture): | 455 class StandaloneArchitecture(Architecture): |
449 """Base class for architectures that run tests without a browser.""" | 456 """Base class for architectures that run tests without a browser.""" |
450 | 457 |
451 def __init__(self, root_path, arch, mode, component, test): | 458 def __init__(self, root_path, arch, mode, component, test): |
452 super(StandaloneArchitecture, self).__init__(root_path, arch, mode, componen
t, | 459 super(StandaloneArchitecture, self).__init__(root_path, arch, mode, componen
t, |
453 test) | 460 test) |
454 | 461 |
455 def GetExecutable(self): | 462 def GetExecutable(self): |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 if component == 'chromium': | 552 if component == 'chromium': |
546 return DartcChromiumArchitecture(root_path, arch, mode, component, test) | 553 return DartcChromiumArchitecture(root_path, arch, mode, component, test) |
547 | 554 |
548 elif component == 'dartium': | 555 elif component == 'dartium': |
549 return DartiumArchitecture(root_path, arch, mode, component, test) | 556 return DartiumArchitecture(root_path, arch, mode, component, test) |
550 | 557 |
551 elif component == 'frogium': | 558 elif component == 'frogium': |
552 return FrogChromiumArchitecture(root_path, arch, mode, component, test) | 559 return FrogChromiumArchitecture(root_path, arch, mode, component, test) |
553 | 560 |
554 elif component == 'webdriver': | 561 elif component == 'webdriver': |
555 return WebDriverArchiecture(root_path, arch, mode, component, test) | 562 return WebDriverArchitecture(root_path, arch, mode, component, test) |
556 | 563 |
557 elif component in ['vm', 'frog', 'frogsh']: | 564 elif component in ['vm', 'frog', 'frogsh']: |
558 return StandaloneArchitecture(root_path, arch, mode, component, test) | 565 return StandaloneArchitecture(root_path, arch, mode, component, test) |
559 | 566 |
560 elif component == 'leg': | 567 elif component == 'leg': |
561 return LegArchitecture(root_path, arch, mode, component, test) | 568 return LegArchitecture(root_path, arch, mode, component, test) |
562 | 569 |
563 elif component == 'dartc': | 570 elif component == 'dartc': |
564 return DartcArchitecture(root_path, arch, mode, component, test) | 571 return DartcArchitecture(root_path, arch, mode, component, test) |
OLD | NEW |