bf13a576fd
Change-Id: I550bb08a2c933799cbaa9586c85869bfc56ce1b0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425328 Auto-Submit: Bob Nystrom <rnystrom@google.com> Commit-Queue: Lasse Nielsen <lrn@google.com> Reviewed-by: Lasse Nielsen <lrn@google.com>
43 lines
1.1 KiB
Dart
43 lines
1.1 KiB
Dart
// Copyright (c) 2022, 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.
|
|
|
|
import 'dart:convert';
|
|
import 'dart:async';
|
|
import 'dart:developer';
|
|
import 'package:expect/expect.dart';
|
|
|
|
final protectedStreams = [
|
|
'VM',
|
|
'Isolate',
|
|
'Debug',
|
|
'GC',
|
|
'_Echo',
|
|
'HeapSnapshot',
|
|
'Logging',
|
|
'Timeline',
|
|
'Profiler',
|
|
'_aStreamThatStartsWithAnUnderScore',
|
|
];
|
|
|
|
main() {
|
|
for (final protectedStream in protectedStreams) {
|
|
Expect.throws(
|
|
() {
|
|
postEvent('theEvent', {'the': 'data'}, stream: protectedStream);
|
|
},
|
|
(_) => true,
|
|
'Should not allow posting to $protectedStream protected stream',
|
|
);
|
|
}
|
|
|
|
// The Extension stream is not protected so calling this should not fail
|
|
postEvent('theEvent', {'the': 'data'}, stream: 'Extension');
|
|
|
|
// Should be allowed to post to a non-protected custom stream
|
|
postEvent('theEvent', {'the': 'data'}, stream: 'someCustomStream');
|
|
|
|
// Should work with immutable map
|
|
postEvent('theEvent', const {'the': 'data'}, stream: 'someCustomStream');
|
|
}
|