aboutsummaryrefslogtreecommitdiffstats
path: root/test_harnesses/automated
diff options
context:
space:
mode:
Diffstat (limited to 'test_harnesses/automated')
-rw-r--r--test_harnesses/automated/automated.coffee19
1 files changed, 12 insertions, 7 deletions
diff --git a/test_harnesses/automated/automated.coffee b/test_harnesses/automated/automated.coffee
index b5e5af35..283e8004 100644
--- a/test_harnesses/automated/automated.coffee
+++ b/test_harnesses/automated/automated.coffee
@@ -2,7 +2,7 @@
# Dispatching keyboard events via the DOM would require async tests,
# which tend to be more complicated. Here we create mock events and
# invoke the handlers directly.
-#
+#
mockKeyboardEvent = (keyChar) ->
event = {}
event.charCode = (if keyCodes[keyChar] isnt undefined then keyCodes[keyChar] else keyChar.charCodeAt(0))
@@ -14,14 +14,14 @@ mockKeyboardEvent = (keyChar) ->
#
# Retrieve the hint markers as an array object.
-#
+#
getHintMarkers = ->
Array::slice.call document.getElementsByClassName("vimiumHintMarker"), 0
#
# Generate tests that are common to both default and filtered
# link hinting modes.
-#
+#
createGeneralHintTests = (isFilteredMode) ->
context "Link hints",
@@ -124,7 +124,8 @@ context "Filtered link hints",
context "Image hints",
setup ->
- testContent = "<a><img alt='alt text'/></a>" + "<a><img alt='alt text' title='some title'/></a>" + "<a><img title='some title'/></a>" + "<a><img src='' width='320px' height='100px'/></a>"
+ testContent = "<a><img alt='alt text'/></a><a><img alt='alt text' title='some title'/></a>
+ <a><img title='some title'/></a>" + "<a><img src='' width='320px' height='100px'/></a>"
document.getElementById("test-div").innerHTML = testContent
LinkHints.activateMode()
@@ -142,7 +143,10 @@ context "Filtered link hints",
context "Input hints",
setup ->
- testContent = "<input type='text' value='some value'/>" + "<input type='password' value='some value'/>" + "<textarea>some text</textarea>" + "<label for='test-input'/>a label</label><input type='text' id='test-input' value='some value'/>" + "<label for='test-input-2'/>a label: </label><input type='text' id='test-input-2' value='some value'/>"
+ testContent = "<input type='text' value='some value'/><input type='password' value='some value'/>
+ <textarea>some text</textarea><label for='test-input'/>a label</label>
+ <input type='text' id='test-input' value='some value'/>
+ <label for='test-input-2'/>a label: </label><input type='text' id='test-input-2' value='some value'/>"
document.getElementById("test-div").innerHTML = testContent
LinkHints.activateMode()
@@ -161,7 +165,8 @@ context "Filtered link hints",
context "Input focus",
setup ->
- testContent = "<input type='text' id='first'/>" + "<input style='display:none;' id='second'/>" + "<input type='password' id='third' value='some value'/>"
+ testContent = "<input type='text' id='first'/><input style='display:none;' id='second'/>
+ <input type='password' id='third' value='some value'/>"
document.getElementById("test-div").innerHTML = testContent
tearDown ->
@@ -182,7 +187,7 @@ Tests.outputMethod = (args...) ->
# escape html
newOutput = newOutput.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
# highlight the source of the error
- newOutput = newOutput.replace(/\/([^:/]+):([0-9]+):([0-9]+)/, "/<span class='errorPosition'>$1:$2</span>:$3")
+ newOutput = newOutput.replace /\/([^:/]+):([0-9]+):([0-9]+)/, "/<span class='errorPosition'>$1:$2</span>:$3"
document.getElementById("output-div").innerHTML += "<div class='output-section'>" + newOutput + "</div>"
console.log.apply console, args