| 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 """Common TestCase subclasses used to define a single test.""" | 5 """Common TestCase subclasses used to define a single test.""" |
| 6 | 6 |
| 7 import os | 7 import os |
| 8 import tempfile | 8 import tempfile |
| 9 | 9 |
| 10 import test | 10 import test |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 """Determine if this is a negative test. by looking at @ directives. | 79 """Determine if this is a negative test. by looking at @ directives. |
| 80 | 80 |
| 81 A negative test is considered to pas if its outcome is FAIL. | 81 A negative test is considered to pas if its outcome is FAIL. |
| 82 | 82 |
| 83 Returns: | 83 Returns: |
| 84 True if this is a negative test. | 84 True if this is a negative test. |
| 85 """ | 85 """ |
| 86 if self.kind == 'compile-time error': | 86 if self.kind == 'compile-time error': |
| 87 return True | 87 return True |
| 88 if self.kind == 'runtime error': | 88 if self.kind == 'runtime error': |
| 89 return False | 89 return True |
| 90 if self.kind == 'static type error': | 90 if self.kind == 'static type error': |
| 91 return self.run_arch.HasFatalTypeErrors() | 91 return self.run_arch.HasFatalTypeErrors() |
| 92 return False | 92 return False |
| 93 | 93 |
| 94 | 94 |
| 95 class BrowserTestCase(StandardTestCase): | 95 class BrowserTestCase(StandardTestCase): |
| 96 """A test case that executes inside a browser (or DumpRenderTree).""" | 96 """A test case that executes inside a browser (or DumpRenderTree).""" |
| 97 | 97 |
| 98 def __init__(self, context, path, filename, | 98 def __init__(self, context, path, filename, |
| 99 fatal_static_type_errors, mode, arch, component, vm_options=None)
: | 99 fatal_static_type_errors, mode, arch, component, vm_options=None)
: |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 self.filename] | 161 self.filename] |
| 162 | 162 |
| 163 return cmd | 163 return cmd |
| 164 | 164 |
| 165 def GetName(self): | 165 def GetName(self): |
| 166 return self.path[-1] | 166 return self.path[-1] |
| 167 | 167 |
| 168 def Cleanup(self): | 168 def Cleanup(self): |
| 169 if not self.context.keep_temporary_files: | 169 if not self.context.keep_temporary_files: |
| 170 self.run_arch.Cleanup() | 170 self.run_arch.Cleanup() |
| OLD | NEW |