4c1d2a461b
Pete's CL (https://codereview.chromium.org/184033007/). I've marked the differences in the CL. R=jmesserly@google.com Review URL: https://codereview.chromium.org//319263002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37144 260f80e4-7a28-3924-810f-c04153c831b5
60 lines
1.8 KiB
HTML
60 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="dart.unittest" content="full-stack-traces">
|
|
<title> interop_test.html </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/platform.js"></script>
|
|
<script src="/packages/web_components/dart_support.js"></script>
|
|
</head>
|
|
<body>
|
|
<h1> Running interop_test </h1>
|
|
<script>
|
|
var counter = 0;
|
|
var A = function() {};
|
|
A.prototype = Object.create(HTMLElement.prototype);
|
|
A.prototype.inc = function() { this.x = counter++; };
|
|
A.prototype.createdCallback = function() { this.inc(); };
|
|
|
|
var B = function() {};
|
|
B.prototype = Object.create(HTMLDivElement.prototype);
|
|
B.prototype.createdCallback = function() { this.x = counter++; };
|
|
B.extends = 'div';
|
|
|
|
document.registerElement('x-a', A);
|
|
document.registerElement('x-b', B);
|
|
|
|
function registerC() {
|
|
var proto = Object.create(HTMLElement.prototype, {
|
|
inc: { value: function() { this.x = counter++; } },
|
|
createdCallback: {
|
|
value: function() { this.inc(); },
|
|
configurable: true},
|
|
});
|
|
document.registerElement('x-c', {prototype: proto});
|
|
}
|
|
function addA() {
|
|
document.body.appendChild(document.createElement('x-a'));
|
|
}
|
|
function addB() {
|
|
document.body.appendChild(document.createElement('div', 'x-b'));
|
|
}
|
|
function addC() {
|
|
document.body.appendChild(document.createElement('x-c'));
|
|
}
|
|
</script>
|
|
<x-a id="i1"></x-a>
|
|
<div is="x-b" id="i2"></div>
|
|
<x-c id="i3"></x-b>
|
|
<script type="text/javascript"
|
|
src="/root_dart/tools/testing/dart/test_controller.js"></script>
|
|
%TEST_SCRIPTS%
|
|
</body>
|
|
</html>
|