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

Unified Diff: pkg/analyzer2dart/test/driver_test.dart

Issue 524463006: Use MockSdk to speed-up tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rollback r39701 Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer2dart/lib/src/driver.dart ('k') | pkg/analyzer2dart/test/tree_shaker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/test/driver_test.dart
diff --git a/pkg/analyzer2dart/test/driver_test.dart b/pkg/analyzer2dart/test/driver_test.dart
index d1c5c84f3cf8a25f4583748ddb7830a0e2906c93..cb732422484046b9ca90f4fdb7ab2b22b982d67c 100644
--- a/pkg/analyzer2dart/test/driver_test.dart
+++ b/pkg/analyzer2dart/test/driver_test.dart
@@ -2,24 +2,30 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:analysis_testing/mock_sdk.dart';
+import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:unittest/unittest.dart';
-import 'package:analyzer/src/generated/ast.dart';
import '../lib/src/closed_world.dart';
import '../lib/src/driver.dart';
main() {
+ Driver driver;
+ setUp(() {
+ DartSdk sdk = new MockSdk();
+ driver = new Driver(sdk);
+ });
+
test('setFakeRoot', () {
- Driver driver = new Driver();
var contents = 'main() {}';
Source source = driver.setFakeRoot(contents);
expect(driver.context.getContents(source).data, equals(contents));
});
test('resolveEntryPoint', () {
- Driver driver = new Driver();
String contents = 'main() {}';
FunctionElement element =
driver.resolveEntryPoint(driver.setFakeRoot(contents));
@@ -27,7 +33,6 @@ main() {
});
test('computeWorld', () {
- Driver driver = new Driver();
String contents = '''
main() {
foo();
« no previous file with comments | « pkg/analyzer2dart/lib/src/driver.dart ('k') | pkg/analyzer2dart/test/tree_shaker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698