Skip to content

Commit

Permalink
cool#8648 clipboard: stop fetching the clipboard on text selection cr…
Browse files Browse the repository at this point in the history
…eate in tests

This was just a workaround to keep tests working till they are fixed to
not assume we do an implicit 'copy' as soon as we have a text selection.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I37d16ee2841c41593a5af2fb6ceba025fe1c79e0
  • Loading branch information
vmiklos authored and caolanm committed Apr 23, 2024
1 parent 843b286 commit 28e51d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions browser/src/layer/tile/CanvasTileLayer.js
Expand Up @@ -3258,11 +3258,12 @@ L.CanvasTileLayer = L.Layer.extend({
this._cellCSelections.setPointSet(pointSet);

this._map.removeLayer(this._map._textInput._cursorHandler); // User selected a text, we remove the carret marker.
// Keep fetching the text selection during testing, for now: too many tests
// depend on this behavior currently.
if (L.Browser.hasNavigatorClipboardWrite && !(L.Browser.cypressTest && !this._map._clip._dummyClipboard.useAsyncWrite)) {
if (L.Browser.hasNavigatorClipboardWrite) {
// Just set the selection type, no fetch of the content.
this._map._clip.setTextSelectionType('text');
} else {
// Trigger fetching the selection content, we already need to have
// it locally by the time 'copy' is executed.
if (this._selectionContentRequest) {
clearTimeout(this._selectionContentRequest);
}
Expand Down
2 changes: 0 additions & 2 deletions cypress_test/integration_tests/common/helper.js
Expand Up @@ -1172,8 +1172,6 @@ function setDummyClipboardForCopy(type) {
},
};
},

useAsyncWrite: true,
};
});
}
Expand Down

0 comments on commit 28e51d5

Please sign in to comment.