sku-pg
Version:
Skulpt is a Javascript implementation of Python 2.x. Python that runs in your browser!
58 lines (50 loc) • 1.56 kB
HTML
<html>
<!--
Copyright 2010 The Closure Library Authors. All Rights Reserved.
Use of this source code is governed by an Apache 2.0 License.
See the COPYING file for details.
-->
<head>
<title>Closure Unit Test - goog._jsbinarysize.button</title>
<script src="../../base.js"></script>
<script src="jsbinarysizebutton.js"></script>
<script>
goog.require("goog.testing.jsunit");
</script>
<link rel="stylesheet" type="text/css" href="../../demos/css/demo.css">
<link rel="stylesheet" type="text/css" href="../../demos/css/button.css">
<script>
function setUp() {
goog.dom.getElement('b1').innerHTML = '';
goog.dom.getElement('cb1').innerHTML = '';
}
function tearDown() {
goog.dom.getElement('b1').innerHTML = '';
goog.dom.getElement('cb1').innerHTML = '';
}
function testDrawButton() {
drawButtons();
var buttonElem = goog.dom.getElement('b1').firstChild
assertNotNull("Button container was not rendered", buttonElem);
assertEquals("Button does not have correct title", "I changed the tooltip.",
buttonElem.title);
}
function testDrawCustomButton() {
drawButtons();
var buttonElems = goog.dom.getElement('cb1').childNodes
assertEquals("Incorrect number of buttons rendered", 7, buttonElems.length);
}
</script>
</head>
<body>
<fieldset>
<legend>Buttons should be rendered here <button onclick="drawButtons()">
render</button></legend>
<div id="buttons">
<div id="b1"></div>
<div id="cb1"></div>
</div>
</fieldset>
</body>
</html>