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

Side by Side Diff: pkg/analysis_server/test/src/plugin/plugin_watcher_test.dart

Issue 2830933005: Update PluginWatcher to be more efficient (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « pkg/analysis_server/lib/src/plugin/plugin_watcher.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:typed_data'; 6 import 'dart:typed_data';
7 7
8 import 'package:analysis_server/src/plugin/plugin_manager.dart'; 8 import 'package:analysis_server/src/plugin/plugin_manager.dart';
9 import 'package:analysis_server/src/plugin/plugin_watcher.dart'; 9 import 'package:analysis_server/src/plugin/plugin_watcher.dart';
10 import 'package:analyzer/context/context_root.dart'; 10 import 'package:analyzer/context/context_root.dart';
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // 59 //
60 resourceProvider.newFile( 60 resourceProvider.newFile(
61 resourceProvider.convertPath('/pkg2/lib/pkg2.dart'), ''); 61 resourceProvider.convertPath('/pkg2/lib/pkg2.dart'), '');
62 resourceProvider.newFile( 62 resourceProvider.newFile(
63 resourceProvider.convertPath('/pkg2/pubspec.yaml'), 'name: pkg2'); 63 resourceProvider.convertPath('/pkg2/pubspec.yaml'), 'name: pkg2');
64 resourceProvider.newFile( 64 resourceProvider.newFile(
65 resourceProvider 65 resourceProvider
66 .convertPath('/pkg2/tools/analysis_plugin/bin/plugin.dart'), 66 .convertPath('/pkg2/tools/analysis_plugin/bin/plugin.dart'),
67 ''); 67 '');
68 await driver.computeResult('package:pkg2/pk2.dart'); 68 await driver.computeResult('package:pkg2/pk2.dart');
69 //
70 // Wait until the timer associated with the driver's FileSystemState is
71 // guaranteed to have expired and the list of changed files will have been
72 // delivered.
73 //
74 await new Future.delayed(new Duration(seconds: 1));
69 expect(manager.addedContextRoots, hasLength(1)); 75 expect(manager.addedContextRoots, hasLength(1));
70 } 76 }
71 77
72 void test_creation() { 78 void test_creation() {
73 expect(watcher.resourceProvider, resourceProvider); 79 expect(watcher.resourceProvider, resourceProvider);
74 expect(watcher.manager, manager); 80 expect(watcher.manager, manager);
75 } 81 }
76 82
77 test_removedDriver() { 83 test_removedDriver() {
78 String pkg1Path = resourceProvider.convertPath('/pkg1'); 84 String pkg1Path = resourceProvider.convertPath('/pkg1');
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return null; 147 return null;
142 } 148 }
143 149
144 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 150 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
145 151
146 @override 152 @override
147 void removedContextRoot(ContextRoot contextRoot) { 153 void removedContextRoot(ContextRoot contextRoot) {
148 removedContextRoots.add(contextRoot); 154 removedContextRoots.add(contextRoot);
149 } 155 }
150 } 156 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/plugin/plugin_watcher.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698