Parse and histogram LevelDB corruption errors.
[chromium-blink-merge.git] / third_party / webdriver / test_data / javascriptPage.html
blob2dffaa72d4477b0648d680e899156cdf980f6b02
1 <?xml version="1.0"?>
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3 <head>
4 <title>Testing Javascript</title>
5 <script type="text/javascript">
6 var seen = {};
8 function updateContent(input) {
9 document.getElementById('result').innerHTML = "<p>" + input.value + "</p>";
12 function displayMessage(message) {
13 document.getElementById('result').innerHTML = "<p>" + message + "</p>";
16 function appendMessage(message) {
17 document.getElementById('result').innerHTML += message + " ";
20 function register(message) {
21 if (!seen[message]) {
22 appendMessage(message);
23 seen[message] = true;
27 function delayedShowHide(delay, show) {
28 var blackBox = document.getElementById('clickToHide');
29 window.setTimeout(function() {
30 blackBox.style.display = show ? '' : 'none';
31 }, delay);
33 </script>
34 <script type="text/javascript">
35 var startList = function() {
36 // Ugh. Let's hope no-one is faking their user agent when running the tests
37 if (navigator.userAgent.indexOf("MSIE") != -1) {
38 var navRoot = document.getElementById("nav");
39 for (var i = 0; i < navRoot.childNodes.length; i++) {
40 var node = navRoot.childNodes[i];
41 if (node.nodeName == "LI") {
42 node.onmouseover = function() {
43 this.className += " over";
45 node.onmouseout = function() {
46 this.className = this.className.replace(" over", "");
52 window.onload=startList;
53 </script>
54 <style type="text/css">
55 #nav {
56 padding: 0; margin: 0; list-style: none;
58 #nav li {
59 float: left; position: relative; width: 10em;
61 #nav li ul {
62 display: none; position: absolute; top: 1em; left: 0;
64 #nav li > ul { top: auto; left: auto; }
65 #nav li:hover ul, #nav li.over ul{ display: block; background: white; }
66 </style>
67 </head>
68 <body>
69 <h1>Type Stuff</h1>
71 <div>
72 <ul id="nav">
73 <li id="menu1">Menu 1
74 <ul>
75 <li id="item1" onclick="displayMessage('item 1');">Item 1</li>
76 <li>Item 2</li>
77 </ul>
78 </li>
79 </ul>
80 </div>
82 <div id="resultContainer" height="30">&nbsp;
83 <div id="result" style="width:300;height:60">
84 <p>&nbsp;</p>
85 </div>
87 </div>
89 <div id="formageddon">
90 <form action="#">
91 Key Up: <input type="text" id="keyUp" onkeyup="javascript:updateContent(this)"/><br/>
92 Key Down: <input type="text" id="keyDown" onkeydown="javascript:updateContent(this)"/><br/>
93 Key Press: <input type="text" id="keyPress" onkeypress="javascript:updateContent(this)"/><br/>
94 Change: <input type="text" id="change" onkeypress="javascript:displayMessage('change')"/><br/>
95 <textarea id="keyDownArea" onkeydown="javascript:updateContent(this)" rows="2" cols="15"></textarea>
96 <textarea id="keyPressArea" onkeypress="javascript:updateContent(this)" rows="2" cols="15"></textarea>
97 <textarea id="keyUpArea" onkeyup="javascript:updateContent(this)" rows="2" cols="15"></textarea>
98 <select id="selector" onchange="javascript:updateContent(this)">
99 <option value="foo">Foo</option>
100 <option value="bar">Bar</option>
101 </select>
102 <input type="checkbox" id="checkbox" value="checkbox thing" onchange="javascript:updateContent(this)"/>
103 <input id="clickField" type="text" onclick="document.getElementById('clickField').value='Clicked';" value="Hello"/>
104 <input id="doubleClickField" type="text" onclick="document.getElementById('doubleClickField').value='Clicked';" ondblclick="document.getElementById('doubleClickField').value='DoubleClicked';" oncontextmenu="document.getElementById('doubleClickField').value='ContextClicked'; return false;" value="DoubleHello"/>
105 <input id="clearMe" value="Something" onchange="displayMessage('Cleared')"/>
106 </form>
107 </div>
109 <div>
110 <p><a href="#" onclick="javascript:document.title='Changed'">Change the page title!</a></p>
112 <p><a onclick="javascript:document.title='Changed'" id="nohref">No href</a></p>
114 <p><a id="updatediv" href="#" onclick="javascript:document.getElementById('dynamo').innerHTML = 'Fish and chips!';">Update a
115 div</a></p>
116 </div>
118 <div id="dynamo">What's for dinner?</div>
120 <div id="mousedown" onmousedown="javascript:displayMessage('mouse down');">
121 <p>Click for the mouse down event</p>
122 <span><p id="child">Here's some text</p></span>
123 </div>
125 <div id="mouseup" onmouseup="javascript:displayMessage('mouse up');">
126 <p>Click for the mouse up event</p>
127 </div>
129 <div id="mouseclick" onclick="javascript:displayMessage('mouse click');">
130 <p>Click for the mouse click event</p>
131 </div>
133 <div id="error" onclick="document.getElementById('doesnotexist').innerHTML = 'cheese';">
134 Clicking this causes a JS exception in the click handler
135 </div>
137 <div>
138 <form action="resultPage.html" id="on-form">
139 <input id="theworks"
140 onfocus="appendMessage('focus')"
141 onkeydown="appendMessage('keydown')"
142 onkeypress="appendMessage('keypress')"
143 onkeyup="appendMessage('keyup')"
144 onblur="appendMessage('blur')"
145 onchange="appendMessage('change')"
148 <input id="changeable" name="changeable" onfocus="appendMessage('focus')" onchange="appendMessage('change')" onblur="appendMessage('blur')"/>
150 <button type="button" id="plainButton"
151 onfocus="appendMessage('focus')"
152 onkeydown="appendMessage('keydown')"
153 onkeypress="appendMessage('keypress')"
154 onkeyup="appendMessage('keyup')"
155 onblur="appendMessage('blur')"
156 onclick="appendMessage('click')"
157 onmousedown="appendMessage('mousedown ')"
158 onmouseup="appendMessage('mouseup ')"
159 onmouseover="register('mouseover ')"
160 onmousemove="register('mousemove ')"
162 <b>Go somewhere</b>
163 </button>
164 <button type="submit" id="submittingButton"><emph>submit</emph></button>
165 <button type="button" id="jsSubmitButton" onclick="javascript:document.getElementById('on-form').submit();">Submitomatic</button>
167 <button type="button" id="switchFocus" onclick="document.getElementById('theworks').focus();">Switch focus</button>
168 <button type="button" onclick="var element = document.getElementById('switchFocus'); var clickEvent = document.createEvent('MouseEvents'); clickEvent.initMouseEvent('click', true, true, null, 0, 0, 0, 0, 0,false, false, false, false, 0, element);element.dispatchEvent(clickEvent);">Do magic</button><br/>
169 <label id="labelForCheckbox" for="labeledCheckbox" onclick="appendMessage('labelclick')">Toggle checkbox</label><input type="checkbox" id="labeledCheckbox" onclick="appendMessage('chboxclick')"/>
170 </form>
172 <form action="javascriptPage.html" id="submitListeningForm" onsubmit="appendMessage('form-onsubmit '); return false;">
174 <input id="submitListeningForm-text" type="text" onsubmit="appendMessage('text-onsubmit ')" onclick="appendMessage('text-onclick ');" />
175 <input id="submitListeningForm-submit" type="submit" onsubmit="appendMessage('submit-onsubmit ')" onclick="appendMessage('submit-onclick ');" />
176 </p>
177 </form>
178 </div>
180 <p id="suppressedParagraph" style="display: none">A paragraph suppressed using CSS display=none</p>
182 <div>
183 <p id="displayed">Displayed</p>
185 <form action="#"><input type="hidden" name="hidden" /> </form>
187 <p id="none" style="display: none;">Display set to none</p>
189 <p id="hidden" style="visibility: hidden;">Hidden</p>
191 <div id="hiddenparent" style="height: 2em; display: none;">
192 <div id="hiddenchild">
193 <a href="#" id="hiddenlink">ok</a>
194 </div>
195 </div>
197 <div style="visibility: hidden;">
198 <span>
199 <input id="unclickable" />
200 <input type="checkbox" id="untogglable" checked="checked" />Check box you can't see
201 </span>
202 </div>
204 <p id="outer" style="visibility: hidden">A <b id="visibleSubElement" style="visibility: visible">sub-element that is explicitly visible</b> using CSS visibility=visible</p>
205 </div>
207 <div>
208 <form>
209 <input type="text" id="keyReporter" size="80"
210 onkeyup="appendMessage('up: ' + event.keyCode)"
211 onkeypress="appendMessage('press: ' + event.keyCode)"
212 onkeydown="displayMessage(''); appendMessage('down: ' + event.keyCode)" />
213 <input name="suppress" onkeydown="if (event.preventDefault) event.preventDefault(); event.returnValue = false; return false;" onkeypress="appendMessage('press');"/>
214 </form>
215 </div>
217 <!-- Used for testing styles -->
218 <div style="background-color: green;" id="green-parent">
219 <p id="style1">This should be greenish</p>
220 <ul>
221 <li id="green-item">So should this</li>
222 <li id="red-item" style="background-color: red;">But this is red</li>
223 </ul>
224 </div>
226 <a href="#" id="close" onclick="window.close();">Close window</a>
228 <div id="delete" onclick="var d = document.getElementById('deleted'); this.removeChild(d);">
229 <p id="deleted">I should be deleted when you click my containing div</p>
230 <p>Whereas, I should not</p>
231 </div>
233 <div>
234 <span id="hideMe" onclick="this.style.display = 'none';">Click to hide me.</span>
235 </div>
237 <div style="margin-top: 10px;">
238 Click actions delayed by 3000ms:
239 <div id="clickToShow" onclick="delayedShowHide(3000, true);"
240 style="float: left;width: 100px;height:100px;border: 1px solid black;">
241 Click to show black box
242 </div>
243 <div id="clickToHide" onclick="delayedShowHide(3000, false);"
244 style="float: left;width: 100px;height:100px;border: 1px solid black;
245 background-color: black; color: white; display: none;">
246 Click to hide black box
247 </div>
248 <div style="clear: both"></div>
249 </div>
251 <a id="new_window" onmouseup="window.open('closeable_window.html', 'close_me')" href="#">Click me to open a new window</a>
253 <a id="throwing-mouseover" onmouseover="throw new Error()" href="#throwing-mouseover">Mouse over me will throw a JS error</a>
255 <div id="parent">
256 <span id="movable" onmouseover="var p = document.getElementById('movable'); displayMessage('parent matches? ' + (p != event.relatedTarget));">
257 Click on me to show the related target
258 </span>
259 </div>
261 <div id="zero" style="width:0;height:0">
262 <div>
263 <img src="map.png">
264 </div>
265 </div>
267 </body>
268 </html>