blob: c051768e2f76094eb1a9815a40d4300084fed272 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<!--
Copyright (c) 2012 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<head>
<title>UI tests</title>
<script src="base.js"></script>
<script>
base.require('unittest');
base.require('ui');
</script>
</head>
<body>
<script>
'use strict';
var TestElement = tracing.ui.define('div');
TestElement.prototype = {
__proto__: HTMLDivElement.prototype,
decorate: function() {
if (!this.decorateCallCount)
this.decorateCallCount = 0;
this.decorateCallCount++;
}
};
function testDecorateOnceViaNew() {
var testElement = new TestElement();
assertEquals(1, testElement.decorateCallCount);
}
function testDecorateOnceDirectly() {
var testElement = document.createElement('div');
tracing.ui.decorate(testElement, TestElement);
assertEquals(1, testElement.decorateCallCount);
}
</script>
</body>
</html>