| 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 @TestOn("vm") | 5 @TestOn("vm") |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:scheduled_test/descriptor.dart' as d; | 10 import 'package:scheduled_test/descriptor.dart' as d; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 test.stdout.expect(consumeThrough("loaded test 1!")); | 42 test.stdout.expect(consumeThrough("loaded test 1!")); |
| 43 test.stdout.expect(consumeThrough(inOrder([ | 43 test.stdout.expect(consumeThrough(inOrder([ |
| 44 startsWith("Observatory URL: "), | 44 startsWith("Observatory URL: "), |
| 45 "The test runner is paused. Open the dev console in Dartium or the " | 45 "The test runner is paused. Open the dev console in Dartium or the " |
| 46 "Observatory and set breakpoints.", | 46 "Observatory and set breakpoints.", |
| 47 "Once you're finished, return to this terminal and press Enter." | 47 "Once you're finished, return to this terminal and press Enter." |
| 48 ]))); | 48 ]))); |
| 49 | 49 |
| 50 schedule(() async { | 50 schedule(() async { |
| 51 var nextLineFired = false; | 51 var nextLineFired = false; |
| 52 test.stdout.next().then(expectAsync((line) { | 52 test.stdout.next().then(expectAsync1((line) { |
| 53 expect(line, contains("+0: test1.dart: success")); | 53 expect(line, contains("+0: test1.dart: success")); |
| 54 nextLineFired = true; | 54 nextLineFired = true; |
| 55 })); | 55 })); |
| 56 | 56 |
| 57 // Wait a little bit to be sure that the tests don't start running without | 57 // Wait a little bit to be sure that the tests don't start running without |
| 58 // our input. | 58 // our input. |
| 59 await new Future.delayed(new Duration(seconds: 2)); | 59 await new Future.delayed(new Duration(seconds: 2)); |
| 60 expect(nextLineFired, isFalse); | 60 expect(nextLineFired, isFalse); |
| 61 }); | 61 }); |
| 62 | 62 |
| 63 test.writeLine(''); | 63 test.writeLine(''); |
| 64 | 64 |
| 65 test.stdout.expect(consumeThrough("loaded test 2!")); | 65 test.stdout.expect(consumeThrough("loaded test 2!")); |
| 66 test.stdout.expect(consumeThrough(inOrder([ | 66 test.stdout.expect(consumeThrough(inOrder([ |
| 67 startsWith("Observatory URL: "), | 67 startsWith("Observatory URL: "), |
| 68 "The test runner is paused. Open the dev console in Dartium or the " | 68 "The test runner is paused. Open the dev console in Dartium or the " |
| 69 "Observatory and set breakpoints.", | 69 "Observatory and set breakpoints.", |
| 70 "Once you're finished, return to this terminal and press Enter." | 70 "Once you're finished, return to this terminal and press Enter." |
| 71 ]))); | 71 ]))); |
| 72 | 72 |
| 73 schedule(() async { | 73 schedule(() async { |
| 74 var nextLineFired = false; | 74 var nextLineFired = false; |
| 75 test.stdout.next().then(expectAsync((line) { | 75 test.stdout.next().then(expectAsync1((line) { |
| 76 expect(line, contains("+1: test2.dart: success")); | 76 expect(line, contains("+1: test2.dart: success")); |
| 77 nextLineFired = true; | 77 nextLineFired = true; |
| 78 })); | 78 })); |
| 79 | 79 |
| 80 // Wait a little bit to be sure that the tests don't start running without | 80 // Wait a little bit to be sure that the tests don't start running without |
| 81 // our input. | 81 // our input. |
| 82 await new Future.delayed(new Duration(seconds: 2)); | 82 await new Future.delayed(new Duration(seconds: 2)); |
| 83 expect(nextLineFired, isFalse); | 83 expect(nextLineFired, isFalse); |
| 84 }); | 84 }); |
| 85 | 85 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 105 test.stdout.expect(consumeThrough("loaded test!")); | 105 test.stdout.expect(consumeThrough("loaded test!")); |
| 106 test.stdout.expect(consumeThrough(inOrder([ | 106 test.stdout.expect(consumeThrough(inOrder([ |
| 107 startsWith("Observatory URL: "), | 107 startsWith("Observatory URL: "), |
| 108 "The test runner is paused. Open the dev console in Dartium or the " | 108 "The test runner is paused. Open the dev console in Dartium or the " |
| 109 "Observatory and set breakpoints.", | 109 "Observatory and set breakpoints.", |
| 110 "Once you're finished, return to this terminal and press Enter." | 110 "Once you're finished, return to this terminal and press Enter." |
| 111 ]))); | 111 ]))); |
| 112 | 112 |
| 113 schedule(() async { | 113 schedule(() async { |
| 114 var nextLineFired = false; | 114 var nextLineFired = false; |
| 115 test.stdout.next().then(expectAsync((line) { | 115 test.stdout.next().then(expectAsync1((line) { |
| 116 expect(line, contains("+0: [Dartium] success")); | 116 expect(line, contains("+0: [Dartium] success")); |
| 117 nextLineFired = true; | 117 nextLineFired = true; |
| 118 })); | 118 })); |
| 119 | 119 |
| 120 // Wait a little bit to be sure that the tests don't start running without | 120 // Wait a little bit to be sure that the tests don't start running without |
| 121 // our input. | 121 // our input. |
| 122 await new Future.delayed(new Duration(seconds: 2)); | 122 await new Future.delayed(new Duration(seconds: 2)); |
| 123 expect(nextLineFired, isFalse); | 123 expect(nextLineFired, isFalse); |
| 124 }); | 124 }); |
| 125 | 125 |
| 126 test.writeLine(''); | 126 test.writeLine(''); |
| 127 | 127 |
| 128 test.stdout.expect(consumeThrough("loaded test!")); | 128 test.stdout.expect(consumeThrough("loaded test!")); |
| 129 test.stdout.expect(consumeThrough(inOrder([ | 129 test.stdout.expect(consumeThrough(inOrder([ |
| 130 "The test runner is paused. Open the dev console in Chrome and set " | 130 "The test runner is paused. Open the dev console in Chrome and set " |
| 131 "breakpoints. Once you're finished,", | 131 "breakpoints. Once you're finished,", |
| 132 "return to this terminal and press Enter." | 132 "return to this terminal and press Enter." |
| 133 ]))); | 133 ]))); |
| 134 | 134 |
| 135 schedule(() async { | 135 schedule(() async { |
| 136 var nextLineFired = false; | 136 var nextLineFired = false; |
| 137 test.stdout.next().then(expectAsync((line) { | 137 test.stdout.next().then(expectAsync1((line) { |
| 138 expect(line, contains("+1: [Chrome] success")); | 138 expect(line, contains("+1: [Chrome] success")); |
| 139 nextLineFired = true; | 139 nextLineFired = true; |
| 140 })); | 140 })); |
| 141 | 141 |
| 142 // Wait a little bit to be sure that the tests don't start running without | 142 // Wait a little bit to be sure that the tests don't start running without |
| 143 // our input. | 143 // our input. |
| 144 await new Future.delayed(new Duration(seconds: 2)); | 144 await new Future.delayed(new Duration(seconds: 2)); |
| 145 expect(nextLineFired, isFalse); | 145 expect(nextLineFired, isFalse); |
| 146 }); | 146 }); |
| 147 | 147 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 test.stdout.expect(consumeThrough("loaded test!")); | 186 test.stdout.expect(consumeThrough("loaded test!")); |
| 187 test.stdout.expect(consumeThrough(inOrder([ | 187 test.stdout.expect(consumeThrough(inOrder([ |
| 188 startsWith("Observatory URL: "), | 188 startsWith("Observatory URL: "), |
| 189 "The test runner is paused. Open the dev console in Dartium or the " | 189 "The test runner is paused. Open the dev console in Dartium or the " |
| 190 "Observatory and set breakpoints.", | 190 "Observatory and set breakpoints.", |
| 191 "Once you're finished, return to this terminal and press Enter." | 191 "Once you're finished, return to this terminal and press Enter." |
| 192 ]))); | 192 ]))); |
| 193 | 193 |
| 194 schedule(() async { | 194 schedule(() async { |
| 195 var nextLineFired = false; | 195 var nextLineFired = false; |
| 196 test.stdout.next().then(expectAsync((line) { | 196 test.stdout.next().then(expectAsync1((line) { |
| 197 expect(line, contains("+0: [Dartium] success")); | 197 expect(line, contains("+0: [Dartium] success")); |
| 198 nextLineFired = true; | 198 nextLineFired = true; |
| 199 })); | 199 })); |
| 200 | 200 |
| 201 // Wait a little bit to be sure that the tests don't start running without | 201 // Wait a little bit to be sure that the tests don't start running without |
| 202 // our input. | 202 // our input. |
| 203 await new Future.delayed(new Duration(seconds: 2)); | 203 await new Future.delayed(new Duration(seconds: 2)); |
| 204 expect(nextLineFired, isFalse); | 204 expect(nextLineFired, isFalse); |
| 205 }); | 205 }); |
| 206 | 206 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 test.stdout.expect(consumeThrough("loaded test 1!")); | 259 test.stdout.expect(consumeThrough("loaded test 1!")); |
| 260 test.stdout.expect(consumeThrough(inOrder([ | 260 test.stdout.expect(consumeThrough(inOrder([ |
| 261 startsWith("Observatory URL: "), | 261 startsWith("Observatory URL: "), |
| 262 "The test runner is paused. Open the dev console in Dartium or the " | 262 "The test runner is paused. Open the dev console in Dartium or the " |
| 263 "Observatory and set breakpoints.", | 263 "Observatory and set breakpoints.", |
| 264 "Once you're finished, return to this terminal and press Enter." | 264 "Once you're finished, return to this terminal and press Enter." |
| 265 ]))); | 265 ]))); |
| 266 | 266 |
| 267 schedule(() async { | 267 schedule(() async { |
| 268 var nextLineFired = false; | 268 var nextLineFired = false; |
| 269 test.stdout.next().then(expectAsync((line) { | 269 test.stdout.next().then(expectAsync1((line) { |
| 270 expect(line, contains("+0: success")); | 270 expect(line, contains("+0: success")); |
| 271 nextLineFired = true; | 271 nextLineFired = true; |
| 272 })); | 272 })); |
| 273 | 273 |
| 274 // Wait a little bit to be sure that the tests don't start running without | 274 // Wait a little bit to be sure that the tests don't start running without |
| 275 // our input. | 275 // our input. |
| 276 await new Future.delayed(new Duration(seconds: 2)); | 276 await new Future.delayed(new Duration(seconds: 2)); |
| 277 expect(nextLineFired, isFalse); | 277 expect(nextLineFired, isFalse); |
| 278 }); | 278 }); |
| 279 | 279 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 301 test.stdout.expect(consumeThrough("loaded test 1!")); | 301 test.stdout.expect(consumeThrough("loaded test 1!")); |
| 302 test.stdout.expect(consumeThrough(inOrder([ | 302 test.stdout.expect(consumeThrough(inOrder([ |
| 303 startsWith("Observatory URL: "), | 303 startsWith("Observatory URL: "), |
| 304 "The test runner is paused. Open the dev console in Dartium or the " | 304 "The test runner is paused. Open the dev console in Dartium or the " |
| 305 "Observatory and set breakpoints.", | 305 "Observatory and set breakpoints.", |
| 306 "Once you're finished, return to this terminal and press Enter." | 306 "Once you're finished, return to this terminal and press Enter." |
| 307 ]))); | 307 ]))); |
| 308 | 308 |
| 309 schedule(() async { | 309 schedule(() async { |
| 310 var nextLineFired = false; | 310 var nextLineFired = false; |
| 311 test.stdout.next().then(expectAsync((line) { | 311 test.stdout.next().then(expectAsync1((line) { |
| 312 expect(line, contains("+0: success")); | 312 expect(line, contains("+0: success")); |
| 313 nextLineFired = true; | 313 nextLineFired = true; |
| 314 })); | 314 })); |
| 315 | 315 |
| 316 // Wait a little bit to be sure that the tests don't start running without | 316 // Wait a little bit to be sure that the tests don't start running without |
| 317 // our input. | 317 // our input. |
| 318 await new Future.delayed(new Duration(seconds: 2)); | 318 await new Future.delayed(new Duration(seconds: 2)); |
| 319 expect(nextLineFired, isFalse); | 319 expect(nextLineFired, isFalse); |
| 320 }); | 320 }); |
| 321 | 321 |
| 322 test.writeLine(''); | 322 test.writeLine(''); |
| 323 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); | 323 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); |
| 324 test.shouldExit(0); | 324 test.shouldExit(0); |
| 325 }, tags: 'dartium'); | 325 }, tags: 'dartium'); |
| 326 } | 326 } |
| OLD | NEW |