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

Unified Diff: pkg/docgen/test/native_extensions_test.dart

Issue 1364553002: remove docgen source and targets from build (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: remove scripts Created 5 years, 3 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/docgen/test/multi_library_test.dart ('k') | pkg/docgen/test/only_lib_content_in_pkg_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/test/native_extensions_test.dart
diff --git a/pkg/docgen/test/native_extensions_test.dart b/pkg/docgen/test/native_extensions_test.dart
deleted file mode 100644
index 70e789c243f21b90e1580b15f94387fc2d0c6c06..0000000000000000000000000000000000000000
--- a/pkg/docgen/test/native_extensions_test.dart
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// 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.
-
-library native_extensions_test;
-
-import 'dart:io';
-
-import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
-
-import '../lib/src/exports/mirrors_util.dart' as dart2js_util;
-import '../lib/docgen.dart';
-
-const String DART_LIBRARY = '''
- library sample_synchronous_extension;
-
- import 'dart-ext:sample_extension';
-
- // The simplest way to call native code: top-level functions.
- int systemRand() native "SystemRand";
- bool systemSrand(int seed) native "SystemSrand";
-
- void main() {
- systemRand();
- systemSrand(4);
- }
-''';
-
-main() {
- group('Generate docs for', () {
- test('file with native extensions.', () {
- var temporaryDir = Directory.systemTemp.createTempSync('native_ext_');
- var fileName = path.join(temporaryDir.path, 'temp.dart');
- var file = new File(fileName);
- file.writeAsStringSync(DART_LIBRARY);
-
- return getMirrorSystem([new Uri.file(fileName)], false)
- .then((mirrorSystem) {
- var testLibraryUri = new Uri.file(path.absolute(fileName),
- windows: Platform.isWindows);
- var library = new Library(mirrorSystem.libraries[testLibraryUri]);
- expect(library is Library, isTrue);
-
- var classTypes = library.classes;
- var classes = [];
- classes.addAll(classTypes.values);
- classes.addAll(library.errors.values);
- expect(classes.every((e) => e is Class), isTrue);
-
- expect(library.typedefs.values.every((e) => e is Typedef), isTrue);
-
- var classMethodTypes = [];
- classes.forEach((e) {
- classMethodTypes.add(e.methods);
- classMethodTypes.add(e.inheritedMethods);
- });
- expect(classMethodTypes.every((e) => e is Map<String, Method>),
- isTrue);
-
- var classMethods = [];
- classMethodTypes.forEach((e) {
- classMethods.addAll(e.values);
- });
- expect(classMethods.every((e) => e is Method), isTrue);
-
- var methodParameters = [];
- classMethods.forEach((e) {
- methodParameters.addAll(e.parameters.values);
- });
- expect(methodParameters.every((e) => e is Parameter), isTrue);
-
- var functionTypes = library.functions;
- expect(functionTypes is Map<String, Method>, isTrue);
-
- var functions = [];
- functions.addAll(functionTypes.values);
- expect(functions.every((e) => e is Method), isTrue);
-
- var functionParameters = [];
- functions.forEach((e) {
- functionParameters.addAll(e.parameters.values);
- });
- expect(functionParameters.every((e) => e is Parameter), isTrue);
-
- var variables = library.variables.values;
- expect(variables.every((e) => e is Variable), isTrue);
-
- // Testing trying to refer to m1 function
- var libraryDocComment =
- library.fixReference('systemRand').children.first.text;
- expect(libraryDocComment, 'sample_synchronous_extension.systemRand');
-
- libraryDocComment =
- library.fixReference('systemSrand').children.first.text;
- expect(libraryDocComment, 'sample_synchronous_extension.systemSrand');
- }).whenComplete(() => temporaryDir.deleteSync(recursive: true));
- });
- });
-}
« no previous file with comments | « pkg/docgen/test/multi_library_test.dart ('k') | pkg/docgen/test/only_lib_content_in_pkg_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698