aboutsummaryrefslogtreecommitdiffstats
path: root/test_harnesses
diff options
context:
space:
mode:
authorPeter Parks2012-01-14 22:17:56 -0800
committerPeter Parks2012-01-15 12:08:06 -0800
commitd2118277a39ddb89e95dbcc2c339b15923caea74 (patch)
treedfd7e6330be8185637ae3aa8fb4e6bc2eb2dc10b /test_harnesses
parent44c36c6ab1c6111f25e535fabfd3b5c75fb4120e (diff)
downloadvimium-d2118277a39ddb89e95dbcc2c339b15923caea74.tar.bz2
Harden and move CSS declarations out of the code.
Remove CSS from background_page.html and change getLinkHintCss to only return the user's overrides. Add vimiumReset class to html generated by completionDialog, helpDialog, linkHints and vimiumFrontEnd Add vimium.css to the manifest and link to it in the tests_harnesses/automated.html and options.html. Add an id, vimiumLinkHintsContainer, to linkhints div to allow user overrides to have a higher specificity. Change the default for the user CSS override.
Diffstat (limited to 'test_harnesses')
-rw-r--r--test_harnesses/automated.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/test_harnesses/automated.html b/test_harnesses/automated.html
index 764b0d2f..ac9b9d37 100644
--- a/test_harnesses/automated.html
+++ b/test_harnesses/automated.html
@@ -26,6 +26,7 @@
border-bottom: dashed 1px #999;
}
</style>
+ <link rel="stylesheet" type="text/css" href="../vimium.css" />
<script type="text/javascript" src="../lib/utils.js"></script>
<script type="text/javascript" src="../lib/keyboardUtils.js"></script>
<script type="text/javascript" src="../linkHints.js"></script>
@@ -223,6 +224,28 @@
assert.equal("5: a label", linkHints.hintMarkers[4].textContent.toLowerCase());
})
+ ),
+
+ context("Input focus",
+
+ setup(function() {
+ var 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(function() {
+ document.getElementById("test-div").innerHTML = "";
+ }),
+
+ should("focus the right element", function() {
+ focusInput(1);
+ assert.equal('first', document.activeElement.id);
+ focusInput(100);
+ assert.equal('third', document.activeElement.id);
+ })
)
);