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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 return path + '.dartium.html' 387 return path + '.dartium.html'
388 388
389 def GetCompileCommand(self, fatal_static_type_errors=False): 389 def GetCompileCommand(self, fatal_static_type_errors=False):
390 fatal_static_type_errors = fatal_static_type_errors # shutup lint! 390 fatal_static_type_errors = fatal_static_type_errors # shutup lint!
391 return None 391 return None
392 392
393 def Compile(self): 393 def Compile(self):
394 return 0 394 return 0
395 395
396 396
397 class WebDriverArchiecture(ChromiumArchitecture):
398 """Architecture that runs compiled dart->JS (via frog) through a variety of
399 real browsers using WebDriver."""
400
401 def __init__(self, root_path, arch, mode, component, test):
402 super(WebDriverArchiecture, self).__init__(root_path, arch, mode, \
403 component, test)
404
405 def GetCompileCommand(self, fatal_static_type_errors=False):
406 """Returns cmdline as an array to invoke the compiler on this test."""
407 # We need an absolute path because the compilation will run
408 # in a temporary directory.
409 build_root = utils.GetBuildRoot(OS_GUESS, self.mode, 'ia32')
410 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
411 'frogsh'))
Siggi Cherem (dart-lang) 2011/11/11 00:06:02 a more compact way to write the 2 lines above: fr
412 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.
413 cmd.append(self.GetTestScriptFile())
414 return cmd
415
416 def GetRunCommand(self, fatal_static_type_errors=False):
417 """Returns a command line to execute for the test."""
418 selenium_location = os.path.join(self.root_path, 'tools', 'testing',
419 'run_selenium.py')
420
421 html_output_file = os.path.join(self.GetHtmlPath(), self.GetHtmlName())
422 f = open(html_output_file, 'w')
423 f.write(self.GetHtmlContents())
424 f.close()
425 return [selenium_location, html_output_file]
426
427
397 class StandaloneArchitecture(Architecture): 428 class StandaloneArchitecture(Architecture):
398 """Base class for architectures that run tests without a browser.""" 429 """Base class for architectures that run tests without a browser."""
399 430
400 def __init__(self, root_path, arch, mode, component, test): 431 def __init__(self, root_path, arch, mode, component, test):
401 super(StandaloneArchitecture, self).__init__(root_path, arch, mode, componen t, 432 super(StandaloneArchitecture, self).__init__(root_path, arch, mode, componen t,
402 test) 433 test)
403 434
404 def GetExecutable(self): 435 def GetExecutable(self):
405 """Returns the path to the Dart test runner (executes the .dart file).""" 436 """Returns the path to the Dart test runner (executes the .dart file)."""
406 return utils.GetDartRunner(self.mode, self.arch, self.component) 437 return utils.GetDartRunner(self.mode, self.arch, self.component)
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 521
491 522
492 def GetArchitecture(arch, mode, component, test): 523 def GetArchitecture(arch, mode, component, test):
493 root_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..')) 524 root_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..'))
494 if component == 'chromium': 525 if component == 'chromium':
495 return ChromiumArchitecture(root_path, arch, mode, component, test) 526 return ChromiumArchitecture(root_path, arch, mode, component, test)
496 527
497 elif component == 'dartium': 528 elif component == 'dartium':
498 return DartiumArchitecture(root_path, arch, mode, component, test) 529 return DartiumArchitecture(root_path, arch, mode, component, test)
499 530
531 elif component == 'webdriver':
532 return WebDriverArchiecture(root_path, arch, mode, component, test)
533
500 elif component in ['vm', 'frog', 'frogsh']: 534 elif component in ['vm', 'frog', 'frogsh']:
501 return StandaloneArchitecture(root_path, arch, mode, component, test) 535 return StandaloneArchitecture(root_path, arch, mode, component, test)
502 536
503 elif component == 'leg': 537 elif component == 'leg':
504 return LegArchitecture(root_path, arch, mode, component, test) 538 return LegArchitecture(root_path, arch, mode, component, test)
505 539
506 elif component == 'dartc': 540 elif component == 'dartc':
507 return DartcArchitecture(root_path, arch, mode, component, test) 541 return DartcArchitecture(root_path, arch, mode, component, test)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698