OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS d.file |
| 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. |
| 4 |
| 5 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 |
| 7 import '../descriptor.dart' as d; |
| 8 import '../test_pub.dart'; |
| 9 import 'utils.dart'; |
| 10 |
| 11 main() { |
| 12 integration("invalidates cache if asset changed", () { |
| 13 d.dir(appPath, [ |
| 14 d.appPubspec(), |
| 15 d.dir("web", [ |
| 16 d.file("file.txt", "stuff"), |
| 17 ]) |
| 18 ]).create(); |
| 19 |
| 20 pubGet(); |
| 21 pubServe(); |
| 22 |
| 23 var etag; |
| 24 schedule(() async { |
| 25 var response = await scheduleRequest("file.txt"); |
| 26 expect(response.statusCode, equals(200)); |
| 27 expect(response.body, equals("stuff")); |
| 28 etag = response.headers["etag"]; |
| 29 }); |
| 30 |
| 31 d.dir(appPath, [ |
| 32 d.dir("web", [ |
| 33 d.file("file.txt", "new stuff") |
| 34 ]) |
| 35 ]).create(); |
| 36 |
| 37 waitForBuildSuccess(); |
| 38 |
| 39 schedule(() async { |
| 40 var response = await scheduleRequest("file.txt", |
| 41 headers: {"if-none-match": etag}); |
| 42 expect(response.statusCode, equals(200)); |
| 43 expect(response.body, equals("new stuff")); |
| 44 }); |
| 45 |
| 46 endPubServe(); |
| 47 }); |
| 48 } |
OLD | NEW |