Merge ~osomon/oxide:fix-context-menu-unit-tests into oxide:master

Proposed by Olivier Tilloy
Status: Merged
Approved by: Chris Coulson
Approved revision: fc740cba101877009b642c5a904dc319d46e8e27
Merged at revision: 25936d6f2503656737afe0d3cea161acc3cd344f
Proposed branch: ~osomon/oxide:fix-context-menu-unit-tests
Merge into: oxide:master
Diff against target: 15 lines (+2/-2)
1 file modified
qt/tests/qmltests/api/tst_WebView_contextMenu.qml (+2/-2)
Reviewer Review Type Date Requested Status
Oxide Developers Pending
Review via email: mp+322623@code.launchpad.net

Commit message

Make context menu unit tests more robust by always expecting integer coordinates (the menu position is expressed in physical pixels).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/qt/tests/qmltests/api/tst_WebView_contextMenu.qml b/qt/tests/qmltests/api/tst_WebView_contextMenu.qml
2index b1518a6..d3e2f68 100644
3--- a/qt/tests/qmltests/api/tst_WebView_contextMenu.qml
4+++ b/qt/tests/qmltests/api/tst_WebView_contextMenu.qml
5@@ -55,8 +55,8 @@ TestWebView {
6
7 function invokeContextMenu(id) {
8 var r = webView.getTestApi().getBoundingClientRectForSelector("#" + id);
9- var x = r.x + r.width / 2;
10- var y = r.y + r.height / 2;
11+ var x = Math.round(r.x + r.width / 2);
12+ var y = Math.round(r.y + r.height / 2);
13 mouseClick(webView, x, y, Qt.RightButton);
14 verify(webView.waitForContextMenu(),
15 "Timed out waiting for context menu to show");

Subscribers

People subscribed via source and target branches