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

Side by Side Diff: mojo/dart/packages/mojom/test/generate_test.dart

Issue 1441033002: Move mojo and mojom from mojo/public/dart to mojo/dart/packages (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 | « mojo/dart/packages/mojom/pubspec.yaml ('k') | mojo/public/dart/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:mojom/src/command_runner.dart'; 8 import 'package:mojom/src/command_runner.dart';
9 import 'package:mojom/src/utils.dart'; 9 import 'package:mojom/src/utils.dart';
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
11 import 'package:unittest/unittest.dart'; 11 import 'package:unittest/unittest.dart';
12 12
13 final singlePacakgeMojomContents = ''' 13 final singlePacakgeMojomContents = '''
14 [DartPackage="single_package"] 14 [DartPackage="single_package"]
15 module single_package; 15 module single_package;
16 struct SinglePackage { 16 struct SinglePackage {
17 int32 thingo; 17 int32 thingo;
18 }; 18 };
19 '''; 19 ''';
20 20
21 Future runCommand(List<String> args) { 21 Future runCommand(List<String> args) {
22 return new MojomCommandRunner().run(args); 22 return new MojomCommandRunner().run(args);
23 } 23 }
24 24
25 main() async { 25 main() async {
26 String mojoSdk; 26 String mojoSdk;
27 if (Platform.environment['MOJO_SDK'] != null) { 27 if (Platform.environment['MOJO_SDK'] != null) {
28 mojoSdk = Platform.environment['MOJO_SDK']; 28 mojoSdk = Platform.environment['MOJO_SDK'];
29 } else { 29 } else {
30 mojoSdk = path.normalize( 30 mojoSdk = path.normalize(path.join(
31 path.join(path.dirname(Platform.script.path), '..', '..', '..')); 31 path.dirname(Platform.script.path), '..', '..', '..', '..', 'public'));
32 } 32 }
33 if (!await new Directory(mojoSdk).exists()) { 33 if (!await new Directory(mojoSdk).exists()) {
34 fail("Could not find the Mojo SDK"); 34 fail("Could not find the Mojo SDK");
35 } 35 }
36 36
37 final scriptPath = path.dirname(Platform.script.path); 37 final scriptPath = path.dirname(Platform.script.path);
38 38
39 // //test_mojoms/mojom 39 // //test_mojoms/mojom
40 final testMojomPath = path.join(scriptPath, 'test_mojoms'); 40 final testMojomPath = path.join(scriptPath, 'test_mojoms');
41 41
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 singlePackageLibPath, 'single_package', 'single_package.mojom.dart'); 109 singlePackageLibPath, 'single_package', 'single_package.mojom.dart');
110 final resultFile = new File(resultPath); 110 final resultFile = new File(resultPath);
111 expect(await resultFile.exists(), isTrue); 111 expect(await resultFile.exists(), isTrue);
112 112
113 // There should be no stray .mojoms file haning around. 113 // There should be no stray .mojoms file haning around.
114 final mojomsFile = new File(singlePackageMojomsPath); 114 final mojomsFile = new File(singlePackageMojomsPath);
115 expect(await mojomsFile.exists(), isFalse); 115 expect(await mojomsFile.exists(), isFalse);
116 }); 116 });
117 }); 117 });
118 } 118 }
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojom/pubspec.yaml ('k') | mojo/public/dart/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698