Files
sdk/tests/html/track_element_constructor_test.dart
T
Terry Lucas bc75856e54 Update getClientRects, removed xtab, removed bogus entry in dom.json,
expose ServiceWorker, removed query and queryAll from in dart:html,
added constructor to MessageChannel and removed getCssCanvasContext.

Fixed all tests using query and queryAll.

Fixes https://github.com/dart-lang/sdk/issues/25664
Fixes https://github.com/dart-lang/sdk/issues/26349
Fixes https://github.com/dart-lang/sdk/issues/32323
Fixes https://github.com/dart-lang/sdk/issues/32659
Fixes https://github.com/dart-lang/sdk/issues/32675

R=kevmoo@google.com

Change-Id: I687471e80b8fe9c7040673113f424dbaab7c64d4
Reviewed-on: https://dart-review.googlesource.com/48381
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2018-03-27 20:45:33 +00:00

31 lines
1.1 KiB
Dart

// Copyright (c) 2013, 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.
// A regression test for dart2js generating illegal JavaScript code
// dynamically in non-csp mode. The name of the field "defaultValue"
// in JavaScript is "default". This meant that dart2js would create a
// constructor function that looked like this:
//
// function TrackElement(default) { this.default = default; }
import 'dart:html';
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
void main() {
useHtmlConfiguration();
test('', () {
if (!TrackElement.supported) return;
document.body.append(new TrackElement()..defaultValue = true);
if (!document.querySelector('track').defaultValue) {
throw 'Expected default value to be true';
}
document.querySelector('track').defaultValue = false;
if (document.querySelector('track').defaultValue) {
throw 'Expected default value to be false';
}
});
}