Skip to content

Commit b258585

Browse files
rmacnak-googlecommit-bot@chromium.org
authored andcommitted
[observatory] Migrate from deprecated isInstanceOf to isA.
Change-Id: Ie68ebbb1ed46b8000fe6c6110774cd031c20aeaf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155280 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
1 parent dfe1d9b commit b258585

22 files changed

+53
-58
lines changed

runtime/observatory/tests/service/bad_web_socket_address_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void testBadWebSocket() async {
1515
} catch (e) {
1616
error = e;
1717
}
18-
expect(error, new isInstanceOf<NetworkRpcException>());
18+
expect(error, isA<NetworkRpcException>());
1919
}
2020

2121
main() async {

runtime/observatory/tests/service/dev_fs_http_put_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var tests = <VMTest>[
3131
result = await vm.invokeRpcNoUpgrade('_createDevFS', {'fsName': fsId});
3232
expect(result['type'], equals('FileSystem'));
3333
expect(result['name'], equals(fsId));
34-
expect(result['uri'], new isInstanceOf<String>());
34+
expect(result['uri'], isA<String>());
3535

3636
// Write the file by issuing an HTTP PUT.
3737
HttpClient client = new HttpClient();

runtime/observatory/tests/service/dev_fs_http_put_weird_char_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var tests = <VMTest>[
3232
result = await vm.invokeRpcNoUpgrade('_createDevFS', {'fsName': fsId});
3333
expect(result['type'], equals('FileSystem'));
3434
expect(result['name'], equals(fsId));
35-
expect(result['uri'], new isInstanceOf<String>());
35+
expect(result['uri'], isA<String>());
3636

3737
// Write the file by issuing an HTTP PUT.
3838
HttpClient client = new HttpClient();

runtime/observatory/tests/service/dev_fs_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var tests = <VMTest>[
1717
result = await vm.invokeRpcNoUpgrade('_createDevFS', params);
1818
expect(result['type'], equals('FileSystem'));
1919
expect(result['name'], equals('alpha'));
20-
expect(result['uri'], new isInstanceOf<String>());
20+
expect(result['uri'], isA<String>());
2121

2222
result = await vm.invokeRpcNoUpgrade('_listDevFS', {});
2323
expect(result['type'], equals('FileSystemList'));
@@ -62,7 +62,7 @@ var tests = <VMTest>[
6262
result = await vm.invokeRpcNoUpgrade('_createDevFS', {'fsName': fsId});
6363
expect(result['type'], equals('FileSystem'));
6464
expect(result['name'], equals(fsId));
65-
expect(result['uri'], new isInstanceOf<String>());
65+
expect(result['uri'], isA<String>());
6666

6767
bool caughtException = false;
6868
try {

runtime/observatory/tests/service/dev_fs_uri_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var tests = <VMTest>[
3737
result = await vm.invokeRpcNoUpgrade('_createDevFS', {'fsName': fsId});
3838
expect(result['type'], equals('FileSystem'));
3939
expect(result['name'], equals(fsId));
40-
expect(result['uri'], new isInstanceOf<String>());
40+
expect(result['uri'], isA<String>());
4141

4242
// Write the file by issuing an HTTP PUT.
4343
HttpClient client = new HttpClient();

runtime/observatory/tests/service/dev_fs_weird_char_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var tests = <VMTest>[
1919
result = await vm.invokeRpcNoUpgrade('_createDevFS', {'fsName': fsId});
2020
expect(result['type'], equals('FileSystem'));
2121
expect(result['name'], equals(fsId));
22-
expect(result['uri'], new isInstanceOf<String>());
22+
expect(result['uri'], isA<String>());
2323

2424
// Write the file.
2525
result = await vm.invokeRpcNoUpgrade('_writeDevFSFile',

runtime/observatory/tests/service/developer_extension_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var tests = <IsolateTest>[
7373
resumeIsolateAndAwaitEvent(Isolate.kExtensionStream, (ServiceEvent event) {
7474
expect(event.kind, equals(ServiceEvent.kExtension));
7575
expect(event.extensionKind, equals('ALPHA'));
76-
expect(event.extensionData, new isInstanceOf<Map>());
76+
expect(event.extensionData, isA<Map>());
7777
expect(event.extensionData['cat'], equals('dog'));
7878
}),
7979
hasStoppedAtBreakpoint,

runtime/observatory/tests/service/evaluate_in_frame_with_scope_test.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,22 @@ var tests = <IsolateTest>[
4444
var thing2 = thing2Field.staticValue;
4545
print(thing2);
4646

47-
final isInstanceOf<Instance> isInstanceOfInstance =
48-
new isInstanceOf<Instance>();
4947
ServiceObject result = await isolate.evalFrame(0, "x + y + a + b",
5048
scope: <String, ServiceObject>{"a": thing1, "b": thing2});
51-
expect(result, isInstanceOfInstance);
49+
expect(result, isA<Instance>());
5250
print(result);
5351
expect((result as Instance).valueAsString, equals('2033'));
5452

5553
result = await isolate.evalFrame(0, "local + a + b",
5654
scope: <String, ServiceObject>{"a": thing1, "b": thing2});
57-
expect(result, isInstanceOfInstance);
55+
expect(result, isA<Instance>());
5856
print(result);
5957
expect((result as Instance).valueAsString, equals('2033'));
6058

6159
// Note the eval's scope is shadowing the locals' scope.
6260
result = await isolate.evalFrame(0, "x + y",
6361
scope: <String, ServiceObject>{"x": thing1, "y": thing2});
64-
expect(result, isInstanceOfInstance);
62+
expect(result, isA<Instance>());
6563
print(result);
6664
expect((result as Instance).valueAsString, equals('7'));
6765

runtime/observatory/tests/service/get_allocation_profile_public_rpc_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var tests = <IsolateTest>[
4444
result = await isolate.invokeRpcNoUpgrade('getAllocationProfile', params);
4545
expect(result['type'], equals('AllocationProfile'));
4646
var firstReset = result['dateLastAccumulatorReset'];
47-
expect(firstReset, new isInstanceOf<String>());
47+
expect(firstReset, isA<String>());
4848
expect(result.containsKey('dateLastServiceGC'), isFalse);
4949
expect(result.containsKey('_heaps'), isFalse);
5050
expect(result['members'].length, isPositive);
@@ -74,7 +74,7 @@ var tests = <IsolateTest>[
7474
expect(result['type'], equals('AllocationProfile'));
7575
expect(result['dateLastAccumulatorReset'], equals(secondReset));
7676
var firstGC = result['dateLastServiceGC'];
77-
expect(firstGC, new isInstanceOf<String>());
77+
expect(firstGC, isA<String>());
7878
expect(result.containsKey('_heaps'), isFalse);
7979
expect(result['members'].length, isPositive);
8080

runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var tests = <IsolateTest>[
4444
result = await isolate.invokeRpcNoUpgrade('_getAllocationProfile', params);
4545
expect(result['type'], equals('AllocationProfile'));
4646
var firstReset = result['dateLastAccumulatorReset'];
47-
expect(firstReset, new isInstanceOf<String>());
47+
expect(firstReset, isA<String>());
4848
expect(result.containsKey('dateLastServiceGC'), isFalse);
4949
expect(result['_heaps'].length, isPositive);
5050
expect(result['_heaps']['new']['type'], equals('HeapSpace'));
@@ -74,7 +74,7 @@ var tests = <IsolateTest>[
7474
expect(result['type'], equals('AllocationProfile'));
7575
expect(result['dateLastAccumulatorReset'], equals(secondReset));
7676
var firstGC = result['dateLastServiceGC'];
77-
expect(firstGC, new isInstanceOf<String>());
77+
expect(firstGC, isA<String>());
7878
expect(result['_heaps'].length, isPositive);
7979
expect(result['_heaps']['new']['type'], equals('HeapSpace'));
8080
expect(result['_heaps']['old']['type'], equals('HeapSpace'));

0 commit comments

Comments
 (0)