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

Side by Side Diff: sdk/lib/_internal/pub_generated/test/serve/native_watch_replaced_file_test.dart

Issue 896623005: Use native async/await support in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 5 years, 10 months 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
(Empty)
1 // Copyright (c) 2013, 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 library pub_tests;
6
7 import 'dart:async';
8 import 'dart:io';
9
10 import 'package:path/path.dart' as p;
11 import 'package:scheduled_test/scheduled_test.dart';
12
13 import '../descriptor.dart' as d;
14 import '../test_pub.dart';
15 import 'utils.dart';
16
17 main() {
18 // This is a regression test for http://dartbug.com/21402.
19 initConfig();
20 withBarbackVersions("any", () {
21 integration(
22 "picks up files replaced after serving started when using the "
23 "native watcher",
24 () {
25 d.dir(appPath, [d.pubspec({
26 "name": "myapp",
27 "transformers": ["myapp/src/transformer"]
28 }),
29 d.dir("lib", [d.dir("src", [d.file("transformer.dart", REWRITE_TRANS FORMER)])]),
30 d.dir("web", [d.file("file.txt", "before"),]),
31 d.file("other", "after")]).create();
32
33 createLockFile("myapp", pkg: ["barback"]);
34
35 pubServe(args: ["--no-force-poll"]);
36 waitForBuildSuccess();
37 requestShouldSucceed("file.out", "before.out");
38
39 schedule(() {
40 // Replace file.txt by renaming other on top of it.
41 return new File(
42 p.join(
43 sandboxDir,
44 appPath,
45 "other")).rename(p.join(sandboxDir, appPath, "web", "file.txt")) ;
46 });
47
48 // Read the transformed file to ensure the change is actually noticed by
49 // pub and not that we just get the new file contents piped through
50 // without pub realizing they've changed.
51 waitForBuildSuccess();
52 requestShouldSucceed("file.out", "after.out");
53
54 endPubServe();
55 });
56 });
57 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698