| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 define(['dart_sdk', 'async_helper', 'expect', 'unittest', 'is', 'require'], | 5 define(['dart_sdk', 'async_helper', 'expect', 'unittest', 'is', 'require'], |
| 6 function(dart_sdk, async_helper, expect, unittest, is, require) { | 6 function(dart_sdk, async_helper, expect, unittest, is, require) { |
| 7 'use strict'; | 7 'use strict'; |
| 8 | 8 |
| 9 async_helper = async_helper.async_helper; | 9 async_helper = async_helper.async_helper; |
| 10 let minitest = expect.minitest; | 10 let minitest = expect.minitest; |
| 11 let mochaOnError = window.onerror; | 11 let mochaOnError = window.onerror; |
| 12 dart_sdk.dart.trapRuntimeErrors(false); | 12 dart_sdk.dart.trapRuntimeErrors(false); |
| 13 dart_sdk.dart.ignoreWhitelistedErrors(false); |
| 13 dart_sdk._isolate_helper.startRootIsolate(function() {}, []); | 14 dart_sdk._isolate_helper.startRootIsolate(function() {}, []); |
| 14 // Make it easier to debug test failures and required for formatter test that | 15 // Make it easier to debug test failures and required for formatter test that |
| 15 // assumes custom formatters are enabled. | 16 // assumes custom formatters are enabled. |
| 16 dart_sdk._debugger.registerDevtoolsFormatter(); | 17 dart_sdk._debugger.registerDevtoolsFormatter(); |
| 17 | 18 |
| 18 let html_config = unittest.html_config; | 19 let html_config = unittest.html_config; |
| 19 // Test attributes are a list of strings, or a string for a single | 20 // Test attributes are a list of strings, or a string for a single |
| 20 // attribute. Valid attributes are: | 21 // attribute. Valid attributes are: |
| 21 // | 22 // |
| 22 // 'pass' - test passes (default) | 23 // 'pass' - test passes (default) |
| 23 // 'skip' - don't run the test | 24 // 'skip' - don't run the test |
| 24 // 'fail' - test fails | 25 // 'fail' - test fails |
| 25 // 'timeout' - test times out | 26 // 'timeout' - test times out |
| 26 // 'slow' - use 5s timeout instead of default 2s. | 27 // 'slow' - use 5s timeout instead of default 2s. |
| 27 // 'helper' - not a test, used by other tests. | 28 // 'helper' - not a test, used by other tests. |
| 28 // 'unittest' - run separately as a unittest test. | 29 // 'unittest' - run separately as a unittest test. |
| 30 // 'whitelist' - run with whitelisted type errors allowed |
| 29 // | 31 // |
| 30 // Common combinations: | 32 // Common combinations: |
| 31 const pass = 'pass'; | 33 const pass = 'pass'; |
| 32 const fail = 'fail'; | 34 const fail = 'fail'; |
| 33 const skip_timeout = ['skip', 'timeout']; | 35 const skip_timeout = ['skip', 'timeout']; |
| 34 | 36 |
| 35 // Browsers | 37 // Browsers |
| 36 const firefox_fail = is.firefox() ? fail : pass; | 38 const firefox_fail = is.firefox() ? fail : pass; |
| 37 const chrome_fail = is.chrome() ? fail : pass; | 39 const chrome_fail = is.chrome() ? fail : pass; |
| 38 | 40 |
| 39 // These are typically tests with asynchronous exceptions that our | 41 // These are typically tests with asynchronous exceptions that our |
| 40 // test framework doesn't always catch. | 42 // test framework doesn't always catch. |
| 41 const flaky = 'skip'; | 43 const flaky = 'skip'; |
| 44 const whitelist = 'whitelist'; |
| 42 | 45 |
| 43 // Tests marked with this are still using the deprecated unittest package | 46 // Tests marked with this are still using the deprecated unittest package |
| 44 // because they rely on its support for futures and asynchronous tests, which | 47 // because they rely on its support for futures and asynchronous tests, which |
| 45 // expect and minitest do not handle. | 48 // expect and minitest do not handle. |
| 46 // TODO(rnystrom): Move all of these away from using the async test API so | 49 // TODO(rnystrom): Move all of these away from using the async test API so |
| 47 // they can stop using unittest. | 50 // they can stop using unittest. |
| 48 const async_unittest = ['unittest', 'skip', 'fail']; | 51 const async_unittest = ['unittest', 'skip', 'fail']; |
| 49 | 52 |
| 50 // The number of expected unittest errors should be zero but unfortunately | 53 // The number of expected unittest errors should be zero but unfortunately |
| 51 // there are a lot of broken html unittests. | 54 // there are a lot of broken html unittests. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 71 | 74 |
| 72 // TODO(vsm): Re-enable (https://github.com/dart-lang/sdk/issues/28319) | 75 // TODO(vsm): Re-enable (https://github.com/dart-lang/sdk/issues/28319) |
| 73 'async_star_test_none_multi': async_unittest, | 76 'async_star_test_none_multi': async_unittest, |
| 74 'async_star_test_01_multi': async_unittest, | 77 'async_star_test_01_multi': async_unittest, |
| 75 'async_star_test_02_multi': async_unittest, | 78 'async_star_test_02_multi': async_unittest, |
| 76 'async_star_test_03_multi': async_unittest, | 79 'async_star_test_03_multi': async_unittest, |
| 77 'async_star_test_04_multi': async_unittest, | 80 'async_star_test_04_multi': async_unittest, |
| 78 'async_star_test_05_multi': async_unittest, | 81 'async_star_test_05_multi': async_unittest, |
| 79 | 82 |
| 80 'async_switch_test': fail, | 83 'async_switch_test': fail, |
| 84 'async_test': whitelist, |
| 85 'async_this_bound_test': whitelist, |
| 81 'asyncstar_throw_in_catch_test': ['skip', 'fail'], | 86 'asyncstar_throw_in_catch_test': ['skip', 'fail'], |
| 82 'await_future_test': skip_timeout, | 87 'await_future_test': skip_timeout, |
| 83 'bit_operations_test_none_multi': fail, // DDC/dart2js canonicalize bitop
results to unsigned | 88 'bit_operations_test_none_multi': fail, // DDC/dart2js canonicalize bitop
results to unsigned |
| 84 'branch_canonicalization_test': fail, // JS bit operations truncate to 32
bits. | 89 'branch_canonicalization_test': fail, // JS bit operations truncate to 32
bits. |
| 85 'call_closurization_test': fail, // Functions do not expose a "call" metho
d. | 90 'call_closurization_test': fail, // Functions do not expose a "call" metho
d. |
| 86 'call_through_null_getter_test': fail, // null errors are not converted to
NoSuchMethodErrors. | 91 'call_through_null_getter_test': fail, // null errors are not converted to
NoSuchMethodErrors. |
| 87 'call_with_no_such_method_test': fail, // Function.apply not really implem
ented. | 92 'call_with_no_such_method_test': fail, // Function.apply not really implem
ented. |
| 88 'canonical_const2_test': fail, | 93 'canonical_const2_test': fail, |
| 89 'canonical_const_test': fail, | 94 'canonical_const_test': fail, |
| 90 'cast_test_01_multi': fail, | 95 'cast_test_01_multi': fail, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 'function_subtype_bound_closure1_test': fail, | 156 'function_subtype_bound_closure1_test': fail, |
| 152 'function_subtype_bound_closure2_test': fail, | 157 'function_subtype_bound_closure2_test': fail, |
| 153 'function_subtype_bound_closure3_test': fail, | 158 'function_subtype_bound_closure3_test': fail, |
| 154 'function_subtype_bound_closure4_test': fail, | 159 'function_subtype_bound_closure4_test': fail, |
| 155 'function_subtype_bound_closure5_test': fail, | 160 'function_subtype_bound_closure5_test': fail, |
| 156 'function_subtype_bound_closure5a_test': fail, | 161 'function_subtype_bound_closure5a_test': fail, |
| 157 'function_subtype_bound_closure6_test': fail, | 162 'function_subtype_bound_closure6_test': fail, |
| 158 'function_subtype_call0_test': fail, // Strong mode "is" rejects some type
tests. | 163 'function_subtype_call0_test': fail, // Strong mode "is" rejects some type
tests. |
| 159 'function_subtype_call1_test': fail, | 164 'function_subtype_call1_test': fail, |
| 160 'function_subtype_call2_test': fail, | 165 'function_subtype_call2_test': fail, |
| 161 'function_subtype_cast0_test': fail, | |
| 162 'function_subtype_cast1_test': fail, | |
| 163 'function_subtype_cast2_test': fail, | |
| 164 'function_subtype_cast3_test': fail, | |
| 165 'function_subtype_factory0_test': fail, | 166 'function_subtype_factory0_test': fail, |
| 166 'function_subtype_inline0_test': fail, | 167 'function_subtype_inline0_test': fail, |
| 167 'function_subtype_local0_test': fail, | 168 'function_subtype_local0_test': fail, |
| 168 'function_subtype_local1_test': fail, | 169 'function_subtype_local1_test': fail, |
| 169 'function_subtype_local2_test': fail, | 170 'function_subtype_local2_test': fail, |
| 170 'function_subtype_local3_test': fail, | 171 'function_subtype_local3_test': fail, |
| 171 'function_subtype_local4_test': fail, | 172 'function_subtype_local4_test': fail, |
| 172 'function_subtype_local5_test': fail, | 173 'function_subtype_local5_test': fail, |
| 173 'function_subtype_named1_test': fail, | 174 'function_subtype_named1_test': fail, |
| 174 'function_subtype_named2_test': fail, | 175 'function_subtype_named2_test': fail, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 201 'instanceof4_test_none_multi': fail, | 202 'instanceof4_test_none_multi': fail, |
| 202 'instanceof_optimized_test': fail, | 203 'instanceof_optimized_test': fail, |
| 203 'integer_division_by_zero_test': fail, | 204 'integer_division_by_zero_test': fail, |
| 204 'issue_22780_test_01_multi': fail, | 205 'issue_22780_test_01_multi': fail, |
| 205 'lazy_static3_test': fail, | 206 'lazy_static3_test': fail, |
| 206 'least_upper_bound_expansive_test_none_multi': fail, | 207 'least_upper_bound_expansive_test_none_multi': fail, |
| 207 'left_shift_test': fail, | 208 'left_shift_test': fail, |
| 208 'list_is_test': fail, | 209 'list_is_test': fail, |
| 209 'list_literal3_test': fail, | 210 'list_literal3_test': fail, |
| 210 'many_generic_instanceof_test': fail, | 211 'many_generic_instanceof_test': fail, |
| 212 'many_named_arguments_test': whitelist, |
| 211 'map_literal10_test': fail, | 213 'map_literal10_test': fail, |
| 212 'map_literal7_test': fail, | 214 'map_literal7_test': fail, |
| 213 'memory_swap_test': skip_timeout, | 215 'memory_swap_test': skip_timeout, |
| 214 'method_invocation_test': fail, | 216 'method_invocation_test': fail, |
| 215 'mint_arithmetic_test': fail, | 217 'mint_arithmetic_test': fail, |
| 216 'mixin_forwarding_constructor3_test': fail, | 218 'mixin_forwarding_constructor3_test': fail, |
| 217 'mixin_implements_test': fail, | 219 'mixin_implements_test': fail, |
| 218 'mixin_issue10216_2_test': fail, | 220 'mixin_issue10216_2_test': fail, |
| 219 'mixin_mixin2_test': fail, | 221 'mixin_mixin2_test': fail, |
| 220 'mixin_mixin3_test': fail, | 222 'mixin_mixin3_test': fail, |
| 221 'mixin_mixin4_test': fail, | 223 'mixin_mixin4_test': fail, |
| 222 'mixin_mixin5_test': fail, | 224 'mixin_mixin5_test': fail, |
| 223 'mixin_mixin6_test': fail, | 225 'mixin_mixin6_test': fail, |
| 224 'mixin_mixin7_test': fail, | 226 'mixin_mixin7_test': fail, |
| 225 'mixin_mixin_bound2_test': fail, | 227 'mixin_mixin_bound2_test': fail, |
| 226 'mixin_mixin_bound_test': fail, | 228 'mixin_mixin_bound_test': fail, |
| 227 'mixin_mixin_test': fail, | 229 'mixin_mixin_test': fail, |
| 228 'mixin_regress_13688_test': fail, | 230 'mixin_regress_13688_test': fail, |
| 229 'modulo_test': fail, | 231 'modulo_test': fail, |
| 230 'named_parameter_clash_test': fail, | 232 'named_parameter_clash_test': fail, |
| 231 'named_parameters_passing_falsy_test': is.firefox('<=50') ? fail : pass, | 233 'named_parameters_passing_falsy_test': is.firefox('<=50') ? fail : pass, |
| 232 'nan_identical_test': fail, | 234 'nan_identical_test': fail, |
| 233 'nested_switch_label_test': fail, | 235 'nested_switch_label_test': fail, |
| 234 'number_identifier_test_05_multi': fail, | 236 'number_identifier_test_05_multi': fail, |
| 235 'number_identity2_test': fail, | 237 'number_identity2_test': fail, |
| 236 'numbers_test': fail, | 238 'numbers_test': fail, |
| 237 'redirecting_factory_reflection_test': fail, | 239 'redirecting_factory_reflection_test': fail, |
| 240 'reg_exp_test': whitelist, |
| 238 'regress_16640_test': fail, | 241 'regress_16640_test': fail, |
| 239 'regress_18535_test': fail, | 242 'regress_18535_test': fail, |
| 240 'regress_22666_test': fail, | 243 'regress_22666_test': fail, |
| 241 'regress_22777_test': flaky, | 244 'regress_22777_test': flaky, |
| 242 'setter_no_getter_test_01_multi': fail, | 245 'setter_no_getter_test_01_multi': fail, |
| 243 'stack_overflow_stacktrace_test': fail, | 246 'stack_overflow_stacktrace_test': fail, |
| 244 'stack_overflow_test': fail, | 247 'stack_overflow_test': fail, |
| 245 'stacktrace_rethrow_error_test_none_multi': fail, | 248 'stacktrace_rethrow_error_test_none_multi': fail, |
| 246 'stacktrace_rethrow_error_test_withtraceparameter_multi': fail, | 249 'stacktrace_rethrow_error_test_withtraceparameter_multi': fail, |
| 247 'stacktrace_test': chrome_fail, | 250 'stacktrace_test': chrome_fail, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 'hash_set_test_01_multi': fail, | 308 'hash_set_test_01_multi': fail, |
| 306 'hidden_library2_test_01_multi': fail, | 309 'hidden_library2_test_01_multi': fail, |
| 307 'int_modulo_arith_test_bignum_multi': fail, | 310 'int_modulo_arith_test_bignum_multi': fail, |
| 308 'int_modulo_arith_test_modPow_multi': fail, | 311 'int_modulo_arith_test_modPow_multi': fail, |
| 309 'int_modulo_arith_test_none_multi': fail, | 312 'int_modulo_arith_test_none_multi': fail, |
| 310 'int_parse_radix_test_01_multi': fail, // JS implementations disagree on U
+0085 being whitespace. | 313 'int_parse_radix_test_01_multi': fail, // JS implementations disagree on U
+0085 being whitespace. |
| 311 'int_parse_radix_test_02_multi': ['fail', 'timeout', 'skip'], // No bigint
s. | 314 'int_parse_radix_test_02_multi': ['fail', 'timeout', 'skip'], // No bigint
s. |
| 312 'int_parse_radix_test_none_multi': ['slow'], | 315 'int_parse_radix_test_none_multi': ['slow'], |
| 313 'integer_to_radix_string_test': fail, | 316 'integer_to_radix_string_test': fail, |
| 314 'integer_to_string_test_01_multi': fail, | 317 'integer_to_string_test_01_multi': fail, |
| 315 'iterable_generate_test': fail, | 318 'iterable_empty_test': whitelist, |
| 319 'iterable_join_test': whitelist, |
| 316 'iterable_return_type_test_02_multi': fail, | 320 'iterable_return_type_test_02_multi': fail, |
| 317 'json_map_test': fail, | 321 'json_map_test': fail, |
| 318 'list_fill_range_test': fail, | 322 'list_fill_range_test': fail, |
| 323 'list_insert_all_test': whitelist, |
| 319 'list_replace_range_test': fail, | 324 'list_replace_range_test': fail, |
| 320 'list_set_all_test': fail, | 325 'list_set_all_test': fail, |
| 321 'list_to_string2_test': fail, | 326 'list_to_string2_test': fail, |
| 322 'main_test': fail, | 327 'main_test': fail, |
| 323 'map_keys2_test': fail, | 328 'map_keys2_test': fail, |
| 324 'map_to_string_test': fail, | 329 'map_to_string_test': fail, |
| 325 'map_from_iterable_test': is.firefox('<=50') ? fail : pass, | 330 'map_from_iterable_test': is.firefox('<=50') ? fail : pass, |
| 326 'nan_infinity_test_01_multi': fail, | 331 'nan_infinity_test_01_multi': fail, |
| 327 'null_nosuchmethod_test': fail, | 332 'null_nosuchmethod_test': fail, |
| 328 'null_test': fail, | 333 'null_test': fail, |
| 329 'num_sign_test': fail, | 334 'num_sign_test': fail, |
| 335 'reg_exp_all_matches_test': whitelist, |
| 336 'reg_exp_start_end_test': whitelist, |
| 330 'regress_r21715_test': fail, | 337 'regress_r21715_test': fail, |
| 331 'throw_half_surrogate_pair_test_02_multi': fail, | 338 'throw_half_surrogate_pair_test_02_multi': fail, |
| 339 'sort_test': whitelist, |
| 332 'splay_tree_from_iterable_test': is.firefox('<=50') ? fail : pass, | 340 'splay_tree_from_iterable_test': is.firefox('<=50') ? fail : pass, |
| 333 'string_case_test_01_multi': firefox_fail, | 341 'string_case_test_01_multi': firefox_fail, |
| 334 'string_fromcharcodes_test': skip_timeout, | 342 'string_fromcharcodes_test': skip_timeout, |
| 335 'string_operations_with_null_test': fail, | 343 'string_operations_with_null_test': fail, |
| 344 'string_split_test': whitelist, |
| 336 'symbol_reserved_word_test_06_multi': fail, | 345 'symbol_reserved_word_test_06_multi': fail, |
| 337 'symbol_reserved_word_test_09_multi': fail, | 346 'symbol_reserved_word_test_09_multi': fail, |
| 338 'symbol_reserved_word_test_12_multi': fail, | 347 'symbol_reserved_word_test_12_multi': fail, |
| 339 'throw_half_surrogate_pair_test_01_multi': fail, | 348 'throw_half_surrogate_pair_test_01_multi': fail, |
| 340 'unicode_test': firefox_fail, | 349 'unicode_test': firefox_fail, |
| 341 'uri_parameters_all_test': is.firefox('<=50') ? fail : pass, | 350 'uri_parameters_all_test': is.firefox('<=50') ? fail : pass, |
| 342 // TODO(rnystrom): Times out because it tests a huge number of | 351 // TODO(rnystrom): Times out because it tests a huge number of |
| 343 // combinations of URLs (4 * 5 * 5 * 8 * 6 * 6 * 4 = 115200). | 352 // combinations of URLs (4 * 5 * 5 * 8 * 6 * 6 * 4 = 115200). |
| 344 'uri_parse_test': skip_timeout, | 353 'uri_parse_test': skip_timeout, |
| 345 'uri_test': 'slow', | 354 'uri_test': 'slow', |
| 346 | 355 |
| 347 'list_insert_test': fail, | 356 'list_insert_test': fail, |
| 348 'list_removeat_test': fail, | 357 'list_removeat_test': fail, |
| 349 }, | 358 }, |
| 350 | 359 |
| 351 'corelib/regexp': { | 360 'corelib/regexp': { |
| 352 'default_arguments_test': fail, | 361 'default_arguments_test': fail, |
| 353 'UC16_test': firefox_fail, | 362 'UC16_test': firefox_fail, |
| 354 }, | 363 }, |
| 355 | 364 |
| 356 'lib/collection': { | 365 'lib/collection': { |
| 366 'linked_list_test': whitelist, |
| 357 }, | 367 }, |
| 358 | 368 |
| 359 'lib/convert': { | 369 'lib/convert': { |
| 360 'base64_test_01_multi': 'slow', | 370 'base64_test_01_multi': 'slow', |
| 361 'chunked_conversion_utf85_test': 'slow', | 371 'chunked_conversion_utf82_test': whitelist, |
| 372 'chunked_conversion_utf83_test': whitelist, |
| 373 'chunked_conversion_utf85_test': ['whitelist', 'slow'], |
| 374 'chunked_conversion_utf86_test': whitelist, |
| 375 'chunked_conversion_utf87_test': whitelist, |
| 362 | 376 |
| 363 'encoding_test': skip_timeout, | 377 'encoding_test': skip_timeout, |
| 364 | 378 |
| 365 'json_utf8_chunk_test': skip_timeout, | 379 'json_utf8_chunk_test': skip_timeout, |
| 366 'latin1_test': skip_timeout, | 380 'latin1_test': skip_timeout, |
| 367 | 381 |
| 382 'streamed_conversion_json_decode1_test': whitelist, |
| 368 'streamed_conversion_json_encode1_test': skip_timeout, | 383 'streamed_conversion_json_encode1_test': skip_timeout, |
| 369 'streamed_conversion_json_utf8_decode_test': skip_timeout, | 384 'streamed_conversion_json_utf8_decode_test': skip_timeout, |
| 370 'streamed_conversion_json_utf8_encode_test': skip_timeout, | 385 'streamed_conversion_json_utf8_encode_test': skip_timeout, |
| 371 'streamed_conversion_utf8_decode_test': skip_timeout, | 386 'streamed_conversion_utf8_decode_test': skip_timeout, |
| 372 'streamed_conversion_utf8_encode_test': skip_timeout, | 387 'streamed_conversion_utf8_encode_test': skip_timeout, |
| 388 'utf82_test': whitelist, |
| 373 'utf85_test': skip_timeout, | 389 'utf85_test': skip_timeout, |
| 390 'utf8_encode_test': whitelist, |
| 391 'utf8_test': whitelist, |
| 374 }, | 392 }, |
| 375 | 393 |
| 376 'lib/html': { | 394 'lib/html': { |
| 377 'async_spawnuri_test': async_unittest, | 395 'async_spawnuri_test': async_unittest, |
| 378 'async_test': async_unittest, | 396 'async_test': async_unittest, |
| 379 | 397 |
| 380 // was https://github.com/dart-lang/sdk/issues/27578, needs triage | 398 // was https://github.com/dart-lang/sdk/issues/27578, needs triage |
| 381 'audiocontext_test': is.chrome('<=54') ? fail : pass, | 399 'audiocontext_test': is.chrome('<=54') ? fail : pass, |
| 382 | 400 |
| 383 'canvas_test': ['unittest'], | 401 'canvas_test': ['unittest'], |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 'pi_test': skip_timeout, | 509 'pi_test': skip_timeout, |
| 492 'random_big_test': fail, | 510 'random_big_test': fail, |
| 493 }, | 511 }, |
| 494 | 512 |
| 495 'lib/typed_data': { | 513 'lib/typed_data': { |
| 496 // No bigint or int64 support | 514 // No bigint or int64 support |
| 497 'int32x4_bigint_test': fail, | 515 'int32x4_bigint_test': fail, |
| 498 'int64_list_load_store_test': fail, | 516 'int64_list_load_store_test': fail, |
| 499 'typed_data_hierarchy_int64_test': fail, | 517 'typed_data_hierarchy_int64_test': fail, |
| 500 'typed_data_list_test': fail, | 518 'typed_data_list_test': fail, |
| 519 'typed_list_iterable_test': whitelist, |
| 501 }, | 520 }, |
| 502 | 521 |
| 503 'lib/mirrors': { | 522 'lib/mirrors': { |
| 504 'abstract_class_test_none_multi': fail, | 523 'abstract_class_test_none_multi': fail, |
| 505 'accessor_cache_overflow_test': fail, | 524 'accessor_cache_overflow_test': fail, |
| 506 'array_tracing3_test': fail, | 525 'array_tracing3_test': fail, |
| 507 'array_tracing_test': fail, | 526 'array_tracing_test': fail, |
| 508 'basic_types_in_dart_core_test': fail, | 527 'basic_types_in_dart_core_test': fail, |
| 509 'circular_factory_redirection_test_none_multi': fail, | 528 'circular_factory_redirection_test_none_multi': fail, |
| 510 'class_mirror_location_test': fail, | 529 'class_mirror_location_test': fail, |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 // 6. Hangs. In this case, we rely on the underlying mocha framework | 756 // 6. Hangs. In this case, we rely on the underlying mocha framework |
| 738 // timeout. | 757 // timeout. |
| 739 // | 758 // |
| 740 // TODO(vsm): This currently doesn't handle tests that trigger multiple | 759 // TODO(vsm): This currently doesn't handle tests that trigger multiple |
| 741 // asynchronous exceptions. | 760 // asynchronous exceptions. |
| 742 | 761 |
| 743 let mainLibrary = require(module)[libraryName(name)]; | 762 let mainLibrary = require(module)[libraryName(name)]; |
| 744 let negative = /negative_test/.test(name); | 763 let negative = /negative_test/.test(name); |
| 745 let fail = has('fail'); | 764 let fail = has('fail'); |
| 746 | 765 |
| 766 let whitelist = has('whitelist'); |
| 767 dart_sdk.dart.ignoreWhitelistedErrors(whitelist); |
| 768 |
| 747 function finish(error) { | 769 function finish(error) { |
| 748 // If the test left any lingering detritus in the DOM, blow it away | 770 // If the test left any lingering detritus in the DOM, blow it away |
| 749 // so it doesn't interfere with later tests. | 771 // so it doesn't interfere with later tests. |
| 750 if (fail) { | 772 if (fail) { |
| 751 if (negative) { | 773 if (negative) { |
| 752 if (error) { | 774 if (error) { |
| 753 error = new Error( | 775 error = new Error( |
| 754 "negative test marked as 'fail' " + | 776 "negative test marked as 'fail' " + |
| 755 "but passed by throwing:\n" + error); | 777 "but passed by throwing:\n" + error); |
| 756 } | 778 } |
| 757 } else if (error) { | 779 } else if (error) { |
| 758 error = null | 780 error = null |
| 759 } else { | 781 } else { |
| 760 error = new Error("test marked as 'fail' but passed"); | 782 error = new Error("test marked as 'fail' but passed"); |
| 761 } | 783 } |
| 762 } else if (negative) { | 784 } else if (negative) { |
| 763 if (!error) { | 785 if (!error) { |
| 764 error = new Error("test marked as 'negative' but did not throw"); | 786 error = new Error("test marked as 'negative' but did not throw"); |
| 765 } else { | 787 } else { |
| 766 error = null; | 788 error = null; |
| 767 } | 789 } |
| 768 } | 790 } |
| 769 minitest.finishTests(); | 791 minitest.finishTests(); |
| 770 document.body.innerHTML = ''; | 792 document.body.innerHTML = ''; |
| 771 console.log("cleared"); | 793 console.log("cleared"); |
| 772 if (error && !(error instanceof Error)) error = new Error(error); | 794 if (error && !(error instanceof Error)) error = new Error(error); |
| 795 dart_sdk.dart.ignoreWhitelistedErrors(false); |
| 773 done(error); | 796 done(error); |
| 774 } | 797 } |
| 775 | 798 |
| 776 // Intercept uncaught exceptions | 799 // Intercept uncaught exceptions |
| 777 window.onerror = function(message, url, line, column, error) { | 800 window.onerror = function(message, url, line, column, error) { |
| 778 console.warn('Asynchronous error in ' + name + ': ' + message); | 801 console.warn('Asynchronous error in ' + name + ': ' + message); |
| 779 if (!error) { | 802 if (!error) { |
| 780 error = new Error(message); | 803 error = new Error(message); |
| 781 } | 804 } |
| 782 finish(error); | 805 finish(error); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 811 }); | 834 }); |
| 812 } | 835 } |
| 813 } | 836 } |
| 814 | 837 |
| 815 // We run these tests in a mocha test wrapper to avoid the confusing failure | 838 // We run these tests in a mocha test wrapper to avoid the confusing failure |
| 816 // case of dart unittests being interleaved with mocha tests. | 839 // case of dart unittests being interleaved with mocha tests. |
| 817 // In practice we are really just suppressing all mocha test behavior while | 840 // In practice we are really just suppressing all mocha test behavior while |
| 818 // Dart unittests run and then re-enabling it when the dart tests complete. | 841 // Dart unittests run and then re-enabling it when the dart tests complete. |
| 819 html_config.useHtmlConfiguration(); | 842 html_config.useHtmlConfiguration(); |
| 820 test('run all dart unittests', function(done) { // 'function' to allow `this.t
imeout` | 843 test('run all dart unittests', function(done) { // 'function' to allow `this.t
imeout` |
| 844 // Use the whitelist for all unittests - there may be an error in the framew
ork |
| 845 // itself. |
| 846 dart_sdk.dart.ignoreWhitelistedErrors(whitelist); |
| 821 if (unittest_tests.length == 0) return done(); | 847 if (unittest_tests.length == 0) return done(); |
| 822 | 848 |
| 823 // TODO(vsm): We're using an old deprecated version of unittest. | 849 // TODO(vsm): We're using an old deprecated version of unittest. |
| 824 // We need to migrate all tests (in the SDK itself) off of | 850 // We need to migrate all tests (in the SDK itself) off of |
| 825 // unittest. | 851 // unittest. |
| 826 | 852 |
| 827 // All unittests need to be explicitly marked as such above. If | 853 // All unittests need to be explicitly marked as such above. If |
| 828 // not, the unittest framework will be run in a 'normal' test and | 854 // not, the unittest framework will be run in a 'normal' test and |
| 829 // left in an inconsistent state at this point triggering spurious | 855 // left in an inconsistent state at this point triggering spurious |
| 830 // failures. This check ensures we're not in such a state. If it fails, | 856 // failures. This check ensures we're not in such a state. If it fails, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 892 |
| 867 for (let action of unittest_tests) { | 893 for (let action of unittest_tests) { |
| 868 try { | 894 try { |
| 869 action(); | 895 action(); |
| 870 } catch (e) { | 896 } catch (e) { |
| 871 console.error("Caught error tying to setup test:", e); | 897 console.error("Caught error tying to setup test:", e); |
| 872 } | 898 } |
| 873 } | 899 } |
| 874 }); | 900 }); |
| 875 }); | 901 }); |
| OLD | NEW |