Overview and Test Preparation
Process the following tests on Firefox Nightly (during
add-on development only), on the minimum supported Firefox,
on Debian stable's Firefox, and on an up-to-date ungoogled
chromium flatpak. Unless otherwise stated, install the XPI
or CRX package with C-o
and remove it
again when done testing.
The last note above is rather crucial: If you have previously forgotten to do so and notice the presence of some old version of this add-on when you start one of the test browsers below, better remove that version and restart the browser before installing the new version. Otherwise you may end up chasing all sorts of funny phantom symptoms.
For Firefox Nightly, start the browser as
~/tmp/firefox/firefox -p nightly &
Then navigate to
about:debugging#/runtime/this-firefox
to install this add-on as temporary add-on. Alternatively, ensure that optionxpinstall.signatures.required
is set tofalse
and install this add-on as an unsigned instead of a temporary add-on.For the minimum supported Firefox, start the browser as
MOZ_FORCE_DISABLE_E10S=1 ~/work/copy-on-select-2/collateral/firefox-78.15.0esr/firefox -p esr-78 &
Then open the XPI package to be tested with
C-o
, open a new tab to perform the tests in, load the test page in that tab, and finally open the add-on page withC-S-a
. When done testing, remove the add-on again. Any deviation from this procedure may result in the add-on not being activated!For Debian stable's Firefox, start the browser as
firefox -p unprotected &
For ungoogled chromium, install or update flatpak
io.github.ungoogled_software.ungoogled_chromium
and run it withflatpak run io.github.ungoogled_software.ungoogled_chromium &
After installing the CRX package to be tested, select the extension details and switch on option "Allow access to file URLs" there.
Monitor Clipboard vs. Primary Selection
Execute the following command in a terminal to monitor and compare clipboard and primary selection:
watch -t -n1 -x bash -c \ 'c=$( xclip -o -se c ) p=$( xclip -o -se p ) printf "c:%3d %-74.74s\n" "${#c}" "${c@Q}" printf "p:%3d %-74.74s\n" "${#p}" "${p@Q}" test "$c" = "$p" && echo PASS || echo FAIL'
Prepare a Local Test File and HTTP Server
It is hard to otherwise find HTTP(non-S) servers and at some time (?) copying from HTTP-served pages has behaved differently than from HTTPS-served pages.
cp ~/work/copy-on-select-2/content/simple.html /tmp/simple.html while :; do { echo $'HTTP/1.1 200 OK\r\n\r\n'; cat /tmp/simple.html; } | nc -l 8080 done
Basic Functionality
Reset all options before performing the following tests.
Regular Text (PASS)
When shall we three meet again
In thunder, lightning, or in rain?
Disabled Text Area Text (FAIL)
Text Area Text (FAIL)
Text Area Text with Input Element Option (PASS)
Switch on the input element option and repeat the previous test. (GitHub issue 6)
Text Box Text (FAIL)
Text Box Text with Input Element Option (PASS)
Switch on the input element option and repeat the previous test.
Iframe Text (PASS)
(This test results in a FAIL on Firefox 78. And I am not going to document that otherwise or even work around it!)
Non-Text (FAIL)
Select the following image. Without native copy that should clear the primary selection, but not the clipboard. With native copy it should clear both.
Rich Text (PASS)
When shall we three meet again
In thunder, lightning, or in rain?
Rich Text Paste (with Native Copy Only)
Copy-on-select the rich text from the previous test; paste it into the following content-editable text box and ensure that the markup is preserved.
Tests Requiring Separate Pages
- cancel-event: Install a
bubbling event handler on
window.document
that stops propagation of allmouseup
events. (GitHub issue 4) - body-change: Replace the document's body element in a delayed manner. (GitHub issue 8)
Tests Requiring External Pages
- Copy text from a local test file. (PASS)
- Copy text from an HTTP-served page. (PASS)
- Login to https://docs.google.com;
select the hamburger menu; select spreadsheets. Ensure that
copy (
C-c
) and paste (C-v
) work in cells. Remove the test spreadsheet when done. (GitHub issue 1)
After the first test pass reset all options again; switch on the use of the native copy command; then perform a second pass on above tests.
Option Page
Save and Reset
- Open the option page; select "Reset"; toggle the first check box; select "Save"; leave the option page; reopen it and ensure that the first check box is in its toggled state.
- Then select "Reset"; leave the option page; reopen it and ensure that the first check box is in its original state.
Error Handling
- Open the option page; change the value of option "Join multi-range selections with" to a single percent sign; select "Save" and ensure that an error message is displayed below the option input element.
- Then select "Reset" and ensure that the error message is removed again.
Dependency Handling
- Open the option page; select option "Use native copy command" and ensure that option "Trim triple-click paragraph selections" gets disabled.
- Then select "Save"; leave the option page; reopen it and ensure that option "Trim triple-click paragraph selections" is still disabled.
- Then select "Reset" and ensure that option "Trim triple-click paragraph selections" gets enabled.
Dark Mode (FF only)
- Open the option page; open the browser preferences in another tab; switch to "Dark Mode" for website appearance and ensure that the option page turns dark as well.
- Then switch to "Automatic Mode" for website appearance again.
Extended Functionality
Non-Main Button Clicks (PASS)
- Select word "hurlyburly" with a double-click; copy some different text from a non-browser source; press the secondary button twice and ensure that this does not copy the word "hurlyburly" to the clipboard again.
- Repeat that test for the auxilliary button, which you should press on some link.
Main Button Clicks into Existing Selection (PASS)
- Select word "hurlyburly" with a double-click; copy some different text from a non-browser source; press the main button over the selected word "hurlyburly" and ensure that this does not copy the word "hurlyburly" to the clipboard again.
- Switch on the input element option and repeat that test with a text-boxed .
Triple-Click Whitespace Trimming (FF only, FAIL)
- Ensure that the triple-click trimming option is switched on; triple-click on the second line below and ensure that it is copied to the clipboard without leading and trailing whitespace. (We cannot change FF's primary selection, so the test result is what it is.)
When shall we three meet again
In thunder, lightning, or in rain?
Multi-Range Selection Separation (FF only, FAIL)
- Ensure that the multi-range selection separator is on
default
%0a
; control-double-click two words in the first line below and ensure that they are copied to the clipboard with a separating newline character. - Repeat that test, but this time control-select one of the table cells from the second line below and a word from the first line and ensure that they are copied to the clipboard without a separating newline character.
When shall we three meet again
In thunder, | lightning, | or in rain? |
Control-Clicks with Existing Selection (FF only, PASS)
Ensure that the multi-range selection separator is on
default %0a
; select word "hurlyburly" with a
double-click; copy some different text from a non-browser
source; control-click outside of the existing selection and
ensure that this copies the word "hurlyburly" to the
clipboard again, but without any leading or trailing
newline.