OLD | NEW |
1 function isDebugEnabled() | 1 function isDebugEnabled() |
2 { | 2 { |
3 // Add #debug at the end of the url to visually debug the test case. | 3 // Add #debug at the end of the url to visually debug the test case. |
4 return window.location.hash == "#debug"; | 4 return window.location.hash == "#debug"; |
5 } | 5 } |
6 | 6 |
7 function getFlowByName(name) | 7 function getFlowByName(name) |
8 { | 8 { |
9 var namedFlows = document.webkitGetNamedFlows(); | 9 var namedFlows = document.webkitGetNamedFlows(); |
10 return namedFlows[name] ? namedFlows[name] : null; | 10 return namedFlows[name] ? namedFlows[name] : null; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 for (var i = 0; i < current.length; i++) | 195 for (var i = 0; i < current.length; i++) |
196 if (current[i] !== expected[i]) { | 196 if (current[i] !== expected[i]) { |
197 testFailed("Expected [" + expected.toString() + "]. Was [" + cu
rrent.toString() + "]"); | 197 testFailed("Expected [" + expected.toString() + "]. Was [" + cu
rrent.toString() + "]"); |
198 return; | 198 return; |
199 } | 199 } |
200 } catch (ex) { | 200 } catch (ex) { |
201 testFailed(current + " threw exception " + ex); | 201 testFailed(current + " threw exception " + ex); |
202 } | 202 } |
203 testPassed("Array [" + expected.toString() + "] is equal to [" + current.to
String() + "]"); | 203 testPassed("Array [" + expected.toString() + "] is equal to [" + current.to
String() + "]"); |
204 } | 204 } |
| 205 |
| 206 function selectContentByRange(fromX, fromY, toX, toY) { |
| 207 if (!window.testRunner) |
| 208 return; |
| 209 |
| 210 eventSender.mouseMoveTo(fromX, fromY); |
| 211 eventSender.mouseDown(); |
| 212 |
| 213 eventSender.mouseMoveTo(toX, toY); |
| 214 eventSender.mouseUp(); |
| 215 } |
| 216 |
| 217 function selectContentByIds(fromId, toId) { |
| 218 var fromRect = document.getElementById(fromId).getBoundingClientRect(); |
| 219 var toRect = document.getElementById(toId).getBoundingClientRect(); |
| 220 |
| 221 var fromRectVerticalCenter = fromRect.top + fromRect.height / 2; |
| 222 var toRectVerticalCenter = toRect.top + toRect.height / 2; |
| 223 |
| 224 selectContentByRange(fromRect.left, fromRectVerticalCenter, toRect.right, to
RectVerticalCenter); |
| 225 } |
| 226 |
| 227 function selectBaseAndExtent(fromId, fromOffset, toId, toOffset) { |
| 228 var from = document.getElementById(fromId); |
| 229 var to = document.getElementById(toId); |
| 230 |
| 231 var selection = window.getSelection(); |
| 232 selection.setBaseAndExtent(from, fromOffset, to, toOffset); |
| 233 } |
| 234 |
| 235 function mouseClick(positionX, positionY) { |
| 236 if (!window.testRunner) |
| 237 return; |
| 238 |
| 239 eventSender.mouseMoveTo(positionX, positionY); |
| 240 eventSender.mouseDown(); |
| 241 eventSender.mouseUp(); |
| 242 } |
OLD | NEW |