Files
sdk/tests/lib/html/media_stream_test.dart
Srujan Gaddam ef6054d688 Update Chrome to 148.0.7778.5
Also updates a few tests due to changes in how createEvent
can be used. That browser API has been deprecated for a long
time, but only recently did Chrome remove support for
PopStateEvent through that API. So, instead to retain the
original intent of the test, confuses are added after
constructing the event to check that type tests work correctly.

A few other tests are modified to remove code that depends on
createEvent, either through eventType or supported members.

See the Chrome bug for more details on the removal:
https://issues.chromium.org/issues/41228793#comment38

Change-Id: Id55a215583221de3ccdbbeff16a2e17e9e35fb0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494160
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
2026-04-10 09:24:12 -07:00

38 lines
1.1 KiB
Dart

// Copyright (c) 2011, 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:html';
import 'dart:js_interop';
import 'dart:js_interop_unsafe';
import 'package:expect/legacy/minitest.dart'; // ignore: deprecated_member_use_from_same_package
@pragma('dart2js:noInline')
@pragma('dart2js:assumeDynamic')
confuse(f) => f;
main() {
group('constructors', () {
test('MediaStreamEvent', () {
var expectation = globalContext.has('MediaStreamEvent')
? returnsNormally
: throws;
expect(() {
var event = confuse(MediaStreamEvent('media'));
expect(event is MediaStreamEvent, isTrue);
}, expectation);
});
test('MediaStreamTrackEvent', () {
var expectation = globalContext.has('MediaStreamTrackEvent')
? returnsNormally
: throws;
expect(() {
var event = confuse(MediaStreamTrackEvent('media', {}));
expect(event is MediaStreamTrackEvent, isTrue);
}, expectation);
});
});
}