OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 // VMOptions=--error_on_bad_type --error_on_bad_override | 4 // VMOptions=--error_on_bad_type --error_on_bad_override |
5 | 5 |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'package:observatory/service_io.dart'; | 7 import 'package:observatory/service_io.dart'; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
9 import 'test_helper.dart'; | 9 import 'test_helper.dart'; |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } on ServerRpcException catch(e) { | 51 } on ServerRpcException catch(e) { |
52 caughtException = true; | 52 caughtException = true; |
53 expect(e.code, equals(ServerRpcException.kFileSystemDoesNotExist)); | 53 expect(e.code, equals(ServerRpcException.kFileSystemDoesNotExist)); |
54 expect(e.message, "_deleteDevFS: file system 'alpha' does not exist"); | 54 expect(e.message, "_deleteDevFS: file system 'alpha' does not exist"); |
55 } | 55 } |
56 expect(caughtException, isTrue); | 56 expect(caughtException, isTrue); |
57 }, | 57 }, |
58 | 58 |
59 (VM vm) async { | 59 (VM vm) async { |
60 var fsId = 'banana'; | 60 var fsId = 'banana'; |
61 var filePath = '/foobar.dat'; | 61 var filePath = '/foo/bar.dat'; |
62 var fileContents = BASE64.encode(UTF8.encode('fileContents')); | 62 var fileContents = BASE64.encode(UTF8.encode('fileContents')); |
63 | 63 |
64 var result; | 64 var result; |
65 // Create DevFS. | 65 // Create DevFS. |
66 result = await vm.invokeRpcNoUpgrade('_createDevFS', { 'fsName': fsId }); | 66 result = await vm.invokeRpcNoUpgrade('_createDevFS', { 'fsName': fsId }); |
67 expect(result['type'], equals('FileSystem')); | 67 expect(result['type'], equals('FileSystem')); |
68 expect(result['name'], equals(fsId)); | 68 expect(result['name'], equals(fsId)); |
69 expect(result['uri'], new isInstanceOf<String>()); | 69 expect(result['uri'], new isInstanceOf<String>()); |
70 | 70 |
71 bool caughtException = false; | 71 bool caughtException = false; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 // Delete DevFS. | 150 // Delete DevFS. |
151 result = await vm.invokeRpcNoUpgrade('_deleteDevFS', { | 151 result = await vm.invokeRpcNoUpgrade('_deleteDevFS', { |
152 'fsName': fsId, | 152 'fsName': fsId, |
153 }); | 153 }); |
154 expect(result['type'], equals('Success')); | 154 expect(result['type'], equals('Success')); |
155 }, | 155 }, |
156 ]; | 156 ]; |
157 | 157 |
158 main(args) async => runVMTests(args, tests); | 158 main(args) async => runVMTests(args, tests); |
OLD | NEW |