aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
2018-02-05Fix tests.Stephen Blott
2017-12-14Detect click listeners for link hints.Stephen Blott
This is a simpler version of #1167. It detects clickable elements with listeners added with `addEventListener()`. It includes some of @mrmr1993's ideas from #1167 (in fact, it's mostly those ideas tweaked into a slightly different form).
2017-11-09Stub DomUtils.consumeKeyup to fix handler stack testsmrmr1993
2017-11-01Rename Rect.rectOverlaps to Rect.intersectsStrict, clarify the commentmrmr1993
2017-11-01Rename Rect.contains to Rect.intersects, add an explanitory commentmrmr1993
2017-10-29Guard against undefined DomUtils, instead of stubbing in testsmrmr1993
2017-10-28Remove normal mode commands from global scopemrmr1993
2017-10-28Remove invokeCommandString, call NormalModeCommands directlymrmr1993
2017-10-27Include LinkHints, Vomnibar and Marks commands in normal mode filemrmr1993
2017-10-27Split focusInput, move the main part into the normal mode filemrmr1993
2017-10-27Add tests to check that foreground commands are implementedmrmr1993
2017-10-27Move NormalMode to its own content scriptmrmr1993
2017-10-06Correct a longstanding typo in DOM testsmrmr1993
2017-09-29Add stub to fix unit testsmrmr1993
2017-09-18Recognise (FF) internal URLs.Stephen Blott
Recognise URLs like: - moz-extension://c66906b4-3785-4a60-97bc-094a6366017e/pages/options.html Fixes #2657.
2017-08-18Check whether events are trusted before executing listenersmrmr1993
2017-05-01FF - Fix updates from the exclusions popupmrmr1993
This stops |Exclusions| from holding a reference to the |value| parameter passed to |Settings.set|. In Firefox, this object is garbage collected when the owning context (the exclusions popup) is closed. The fix for all such cases in the future is to switch to using |Settings.get|, which implicitly does |JSON.parse JSON.stringify value| and thus returns an object in the same context as |Settings|. We could fix this generally by doing this for the |Settings.performPostUpdateHook| call in |Settings.set| instead. However, I'm not convinced that it warrants the overhead of a |JSON.parse| for every |Settings.set| call.
2017-04-18Remove use of keyCodes entirely.Stephen Blott
event.keyCode` is depricated: - https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
2017-04-18Rework tests for all key handling on keydown.Stephen Blott
2017-02-08Remove stub for deprecated onActiveChangedmrmr1993
2017-02-08Remove stub for deprecated tabs.onSelectionChangedmrmr1993
2016-12-10Merge pull request #2326 from smblott-github/move-search-engines-to-bg-utilsStephen Blott
Move SearchEngines to bg-utils.coffee.
2016-12-10Tweak #2338.Stephen Blott
2016-11-09treat select element as an input, setting focus to itRamiro Araujo
2016-10-23Move SearchEngines to bg-utils.coffee.Stephen Blott
`SearchEngines` was previously in `utils.coffee`, which means it was loaded in *every* content frame. This is unnecessary, since it is only used on the background page. So this PR moves it there. Also: - Simplify some unnecessarily complex logic in `vomnibar.coffee`. - Re-use `Utils.parseLines()` to parse the custom search engine configuation text.
2016-10-23Better line parsing (add tests).Stephen Blott
2016-10-17Better line parsing.Stephen Blott
1. Explicitly remove comments. 2. A trailing backslash means the current line continues on the next line. E.g. a \ b \ c is a single line `a b c`. This helps alleviate the fact that configuration lines can be very long, whereas the *Custom key mappings* input is quite narrow. TODO: We should use the same line parser in the custom-search-engines input.
2016-10-08Refactor (and fix) key-parsing regexp.Stephen Blott
Fixes #2299. Also, separate this regexp out into its constituent parts, because it is becoming too different to read.
2016-10-02More key-sequance parser tests.Stephen Blott
2016-10-02Merge pull request #2284 from smblott-github/silent-releasesStephen Blott
Enable silent/patch releases.
2016-10-02Add tests for compareVersions().Stephen Blott
2016-10-02Better regexp (to match legacy behaviour for '<c->>'.Stephen Blott
2016-10-02Rename normalizeKey to parseKeySequence.Stephen Blott
The new name better describes which the function does.
2016-10-02Rework key-sequence parsing.Stephen Blott
This reworks the parsing of key sequences like `<c-a-Z>x`: Advantages over the status quo: - Parses key sequences in one only place (previously two), - Removes two hideous regular expression. - Admits multi-modifier bindings (like `<c-a-Z>`). - Adds more (and better) tests. - (And it should be easier to maintain.) Replaces #2210 (this also simplifies key parsing substantially).
2016-09-26Tweak jsaction detection and add tests.Stephen Blott
This tweaks the jsaction detection, in particular excluding elements where the "actionName" is "_". I see a lot of these, and clicking them doesn't do anything. Also, added corresponding tests.
2016-09-25Space rotates hints (to make hidden hints visible).Stephen Blott
It is common for link-hint markers to be close togother, and overlapping. Here, `<Space>` rotates hint markers such that hidden markers become visible. For filtered hints we additionally require a modifier (because `<space>` on its own is already a token separator). The calculation of overlapping hints is quite expensive: O(n^2) in the best case and O(n^3) in the worst cast. The worst case is extraordinarily unlikely to arise in practice.
2016-04-18Cache content_scripts/vimium.css in chrome.storage.local.Stephen Blott
Previously, we had two different approaches. This seems like a simpler approach. We simply cache the Vimium CSS in chrome.storage.local (in the background page) and fetch it from there (in UI components). There is also a minor change in the we no longer cache the CSS in memory. This seems to be the right thing to do. Caching the CSS in memory consumes a small amount of memory. However, it can only speed up the fastest loads. It cannot speed up the first load -- which is likely the one that matters most. So caching the CSS in memory seems to make little sense.
2016-04-18Fix tests.Stephen Blott
When the implementation of windowIsFocused() changed, the tests started failing. (It's not clear how I didn't spot this sooner. I've run the tests countless times - and they passed - since that change was made.
2016-04-18Require documentReady for all UI components.Stephen Blott
This replaces c01d7eea8675f9a7d84999777e8de72244d687b6. All UI components require the document to be ready. So, here the constructor waits for DomUtils.documentReady(). The diff looks big, but mainly it's a result of changes in indentation in the constructor and in hide(). Also, hide() now uses @postMessage() to post a null message. This forces hide to use @iframePort.use(), which ensures that hide()s cannot overtake activate()s. This continues #2100.
2016-04-10Fix Vomnibar initialization issue.Stephen Blott
On a slow loading page, as the page is loading, hit `o` repeatedly. Eventually, Vimium hangs. We seem to have had this problem for quite some time (e.g. it's in 1.54). This fixes the problem by ensuring that the Vomnibar is initialized before launching it. Also fix the same issue for the help dialog.
2016-04-08Merge pull request #2088 from ↵Stephen Blott
smblott-github/filtered-hints-better-typed-text-matching Filtered hints: better typed text handling.
2016-04-08Filtered hints; ignore unmatched text.Stephen Blott
When the user is typing a link's text, any mistyped character exits link hints mode. This makes little sense. In practice, this usually happens because the user mis-typed something. Here, we ignore typed characters which do not match any hints. (Also, add a test for this.)
2016-04-08Do not post hint descriptors back to the frame itself.Stephen Blott
When distributing hint descriptors, do not post a frame's own hint descriptors back to the frame itself. It already has them. With regard to the message-passing cost only, this represents a speedup of approximately 3/2 for link-busy sites like reddit -- several tens of milliseconds for me. There are other costs too (such as processing the hint descriptors) bu these are not affected.
2016-04-04Handle requireHref for link hints locally.Stephen Blott
The check that an element as an href (for certain hint modes) can be done earlier, thereby avoid the need to pass that information between frames.
2016-04-02Refactor DomUtils.documentReady.Stephen Blott
We do not need to install separate event listeners for every callback. Just install one listener and keep track of the callbacks ourself. This is clearer, and also determines the order in which callbacks are called. (Although, we don't rely on that currently.) This also adds a tests.
2016-03-30Rename handlerStack constants.Stephen Blott
Problems: - The meanings of some of the Mode/handlerStack constant names is far from obvious. - The same thing is named different things in different places. This changes various constant names such that: - the names used in the handler stack and in the modes are the same. - ditto vis-a-vis DomUtils. Also, break out the core of the handler stacks' `bubbleEvent` method into a switch statements. This makes it more obvious that the cases are mutually exclusive.
2016-03-30Add tests for GrabBackFocus.Stephen Blott
2016-03-30Add test for SuppressAllKeyboardEvents.Stephen Blott
Which: - uncovered a typo in 39adee9090fc5aadfd5dd681f91b80025084858a. Also: - make Mode.debug a class variable, which is more helpful while trying to debug. Specifically, you can turn debugging on or off from within the tests, for example.
2016-03-29Add tests for WaitForEnter.Stephen Blott
2016-03-29Ensure window has focus in tests.Stephen Blott