6c757957db
DDC's codegen test copies those files to a local "gen" directory so that it can do stuff like splitting out the multitests before it compiles them to JS. I left all of that alone, so the rest of DDC's test infrastructure is unchanged. The very first step that builds the "gen" directory just copies from sdk/tests/..._strong/... instead and the rest is good to go. I did not move not_yet_strong_tests.dart somewhere more accessible yet because I'm not sure if kernel needs it or where it should go. I did not create any status files because DDC doesn't need them and there are no test suites for the new directories for the other platforms.
52 lines
1.4 KiB
HTML
52 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<meta name="dart.unittest" content="full-stack-traces">
|
|
<title> element_upgrade_test </title>
|
|
<style>
|
|
.unittest-table { font-family:monospace; border:1px; }
|
|
.unittest-pass { background: #6b3;}
|
|
.unittest-fail { background: #d55;}
|
|
.unittest-error { background: #a11;}
|
|
</style>
|
|
<script src="/packages/web_components/webcomponents.js"></script>
|
|
<script src="/packages/web_components/dart_support.js"></script>
|
|
|
|
<body>
|
|
<h1> Running element_upgrade_test </h1>
|
|
|
|
<script>
|
|
var Foo = function() {};
|
|
Foo.prototype = Object.create(HTMLElement.prototype);
|
|
Foo.prototype.createdCallback = function() {
|
|
this.fooCreated = true;
|
|
this.textContent = 'constructed';
|
|
|
|
// Tell the Dart side that this was created.
|
|
// For testing purposes, for real code this would use a different mechanism.
|
|
window.upgradeListener(this);
|
|
};
|
|
|
|
Foo.prototype.doSomething = function() {
|
|
this.textContent = 'didSomething';
|
|
return 'didSomething';
|
|
};
|
|
|
|
Foo = document.registerElement('x-foo', Foo);
|
|
|
|
function validateIsFoo(element) {
|
|
if (!(element instanceof Foo)) {
|
|
throw Error('Element is not a Foo');
|
|
}
|
|
|
|
if (!element.fooCreated) {
|
|
throw Error('Expected fooCreated to be set');
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<script type="text/javascript"
|
|
src="/root_dart/tools/testing/dart/test_controller.js"></script>
|
|
<script type="text/javascript"
|
|
src="/packages/browser/interop.js"></script>
|
|
%TEST_SCRIPTS%
|
|
</body>
|