Skip to content

Commit 189e3fd

Browse files
John Messerlyjacob314
John Messerly
authored andcommitted
fixes for latest trunk sdk
1 parent 5c2b114 commit 189e3fd

File tree

5 files changed

+16
-189
lines changed

5 files changed

+16
-189
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ tags
55
out
66
.DS_Store
77
*.pyc
8+
.buildlog

client/lib/model.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,13 @@ Future loadModel() {
237237
md.setImplicitLinkResolver(_resolveNameReference);
238238
var completer = new Completer();
239239
library_loader.libraryLoader = (url, callback) {
240-
new html.HttpRequest.get(url, (req) {
241-
callback(req.responseText);
242-
});
240+
html.HttpRequest.getString(url).then(callback);
243241
};
244242
library_loader.onDataModelChanged = _onDataModelChanged;
245243

246244
// TODO(jacobr): shouldn't have to get this from the parent directory.
247-
new html.HttpRequest.get('../static/data/apidoc.json', (req) {
248-
loadPackageJson(req.responseText);
245+
html.HttpRequest.getString('../static/data/apidoc.json').then((text) {
246+
loadPackageJson(text);
249247
_onDataModelChanged();
250248
completer.complete(true);
251249
});

client/test/ast_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
*/
99
library ast_test;
1010

11+
import 'package:unittest/compact_vm_config.dart';
1112
import 'package:unittest/unittest.dart';
1213
import 'package:api_doc/ast.dart';
13-
import 'compact_vm_config.dart';
1414
import 'dart:io';
1515

1616
main() {

client/test/compact_vm_config.dart

Lines changed: 0 additions & 173 deletions
This file was deleted.

client/test/run_all.dart

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
*/
99
library run_impl;
1010

11+
import 'dart:async';
1112
import 'dart:io';
1213
import 'dart:utf' show encodeUtf8;
1314
import 'dart:isolate';
15+
import 'package:unittest/compact_vm_config.dart';
1416
import 'package:unittest/unittest.dart';
1517
import 'package:web_ui/dwc.dart' as dwc;
1618

1719
import 'ast_test.dart' as ast_test;
18-
import 'compact_vm_config.dart';
1920

2021
// TODO(jacobr): command line args to filter tests
2122
main() {
@@ -42,7 +43,7 @@ main() {
4243

4344
test('drt-compile $filename', () {
4445
expect(dwc.run(['-o', 'data/output/', path], printTime: false)
45-
.transform((res) {
46+
.then((res) {
4647
expect(res.messages.length, 0,
4748
reason: Strings.join(res.messages, '\n'));
4849
}), completes);
@@ -54,14 +55,14 @@ main() {
5455
var outputPath = '$htmlPath.txt';
5556
var errorPath = outDir.append('_errors.$filename.txt').toString();
5657

57-
expect(_runDrt(htmlPath, outputPath, errorPath).transform((exitCode) {
58+
expect(_runDrt(htmlPath, outputPath, errorPath).then((exitCode) {
5859
if (exitCode == 0) {
5960
var expectedPath = '$cwd/data/expected/$filename.txt';
60-
expect(_diff(expectedPath, outputPath).transform((res) {
61+
expect(_diff(expectedPath, outputPath).then((res) {
6162
expect(res, 0, reason: "Test output doesn't match expectation.");
6263
}), completes);
6364
} else {
64-
expect(Process.run('cat', [errorPath]).transform((res) {
65+
expect(Process.run('cat', [errorPath]).then((res) {
6566
expect(exitCode, 0, reason:
6667
'DumpRenderTree exited with a non-zero exit code, when running '
6768
'on $filename. Contents of stderr: \n${res.stdout}');
@@ -73,20 +74,20 @@ main() {
7374
}
7475

7576
Future<int> _runDrt(htmlPath, String outPath, String errPath) {
76-
return Process.run('DumpRenderTree', [htmlPath]).chain((res) {
77+
return Process.run('DumpRenderTree', [htmlPath]).then((res) {
7778
var f1 = _writeFile(outPath, res.stdout);
7879
var f2 = _writeFile(errPath, res.stderr);
79-
return Futures.wait([f1, f2]).transform((_) => res.exitCode);
80+
return Future.wait([f1, f2]).then((_) => res.exitCode);
8081
});
8182
}
8283

8384
Future _writeFile(String path, String text) {
8485
return new File(path).open(FileMode.WRITE)
85-
.chain((file) => file.writeString(text))
86-
.chain((file) => file.close());
86+
.then((file) => file.writeString(text))
87+
.then((file) => file.close());
8788
}
8889

8990
Future<int> _diff(expectedPath, outputPath) {
9091
return Process.run('diff', ['-q', expectedPath, outputPath])
91-
.transform((res) => res.exitCode);
92+
.then((res) => res.exitCode);
9293
}

0 commit comments

Comments
 (0)