on xenial help sign in
Update tests.
commitc40b9cf0f4034850eabf3c7d89c3acf8e05a2b2a authorAndrea Azzarone <azzaronea@gmail.com> dateMon 26 Sep 2016, 14:52 (10 years ago) parent0e4d9f5
1 file changed+51−40
tests/qmltests/Launcher/tst_Launcher.qml+51−40
tests/qmltests/Launcher/tst_Launcher.qml+51−40
@@ -1355,78 +1355,89 @@ Rectangle {
13551355 }
13561356
13571357 function test_tooltip() {
1358− dragLauncherIntoView()
1358+ launcher.lockedVisible = true;
1359+ dragLauncherIntoView();
13591360
1360− var item = findChild(launcher, "launcherDelegate0")
1361− var tooltipShape = findChild(launcher, "tooltipShape")
1361+ var item = findChild(launcher, "launcherDelegate0");
1362+ var tooltipShape = findChild(launcher, "tooltipShape");
13621363
13631364 // Make sure we don't start the test with the mouse hovering the launcher
1364− mouseMove(root, root.width, root.height / 2)
1365+ mouseMove(root, root.width, root.height / 2);
13651366
13661367 // Initial state
1367− compare(tooltipShape.visible, false)
1368+ tryCompare(tooltipShape, "visible", false);
13681369
13691370 // Move the mouse on the launcher icon
1370− mouseMove(item, item.width / 2, item.height / 2)
1371− mouseMove(item, item.width / 2 + 1, item.height / 2)
1372− tryCompare(tooltipShape, "visible", true)
1371+ mouseMove(item, item.width / 2, item.height / 2);
1372+ mouseMove(item, item.width / 2 + 1, item.height / 2);
1373+ tryCompare(tooltipShape, "visible", true);
13731374
13741375 // Move the mouse away
1375− mouseMove(root, root.width, root.height / 2)
1376− tryCompare(tooltipShape, "visible", false)
1376+ mouseMove(root, root.width, root.height / 2);
1377+ tryCompare(tooltipShape, "visible", false);
13771378 }
13781379
1379− function test_quicklist_dismiss_tooltip() {
1380− dragLauncherIntoView()
1380+ function test_quicklist_dismisses_tooltip() {
1381+ launcher.lockedVisible = true;
1382+ dragLauncherIntoView();
13811383
1382− var item = findChild(launcher, "launcherDelegate0")
1383− var tooltipShape = findChild(launcher, "tooltipShape")
1384− var quickListShape = findChild(launcher, "quickListShape")
1384+ var item = findChild(launcher, "launcherDelegate0");
1385+ var tooltipShape = findChild(launcher, "tooltipShape");
1386+ var quickListShape = findChild(launcher, "quickListShape");
13851387
13861388 // Make sure we don't start the test with the mouse hovering the launcher
1387− mouseMove(root, root.width, root.height / 2)
1389+ mouseMove(root, root.width, root.height / 2);
13881390
13891391 // Initial state
1390− compare(tooltipShape.visible, false)
1391−
1392− var tooltip = findChild(launcher, "tooltip")
1393−
1392+ tryCompare(tooltipShape, "visible", false);
13941393
13951394 // Move the mouse on the launcher icon
1396− mouseMove(item, item.width / 2, item.height / 2)
1397− mouseMove(item, item.width / 2 + 1, item.height / 2)
1398− tryCompare(tooltipShape, "visible", true)
1399− console.log(tooltip.state)
1400−
1395+ mouseMove(item, item.width / 2, item.height / 2);
1396+ mouseMove(item, item.width / 2 + 1, item.height / 2);
1397+ tryCompare(tooltipShape, "visible", true);
14011398
14021399 // Right click to show the quicklist
1403− mouseClick(item, item.width / 2, item.height / 2, Qt.RightButton)
1404− tryCompare(quickListShape, "visible", true)
1400+ mouseClick(item, item.width / 2, item.height / 2, Qt.RightButton);
1401+ tryCompare(quickListShape, "visible", true);
1402+ tryCompare(tooltipShape, "visible", false);
1403+
1404+ // Left click hides the quicklist, tooltip is still dismissed
1405+ mouseClick(item, item.width / 2, item.height / 2, Qt.LefftButton);
1406+ tryCompare(quickListShape, "visible", false);
1407+ tryCompare(tooltipShape, "visible", false);
14051408
1406− console.log(tooltip.state)
1407− tryCompare(tooltipShape, "visible", false)
1409+ // Mouse motion should should show tooltip again
1410+ mouseMove(item, item.width / 2, item.height / 2);
1411+ mouseMove(item, item.width / 2 + 1, item.height / 2);
1412+ tryCompare(tooltipShape, "visible", true);
14081413 }
14091414
1410− function test_click_dismiss_tooltip() {
1411− dragLauncherIntoView()
1415+ function test_click_dismisses_tooltip() {
1416+ launcher.lockedVisible = true;
1417+ dragLauncherIntoView();
14121418
1413− var item = findChild(launcher, "launcherDelegate0")
1414− var tooltipShape = findChild(launcher, "tooltipShape")
1419+ var item = findChild(launcher, "launcherDelegate0");
1420+ var tooltipShape = findChild(launcher, "tooltipShape");
14151421
14161422 // Make sure we don't start the test with the mouse hovering the launcher
1417− mouseMove(root, root.width, root.height / 2)
1423+ mouseMove(root, root.width, root.height / 2);
14181424
14191425 // Initial state
1420− compare(tooltipShape.visible, false)
1426+ compare(tooltipShape.visible, false);
14211427
14221428 // Move the mouse on the launcher icon
1423− mouseMove(item, item.width / 2, item.height / 2)
1424− mouseMove(item, item.width / 2 + 1, item.height / 2)
1425− tryCompare(tooltipShape, "visible", true)
1429+ mouseMove(item, item.width / 2, item.height / 2);
1430+ mouseMove(item, item.width / 2 + 1, item.height / 2);
1431+ tryCompare(tooltipShape, "visible", true);
14261432
14271433 // Left click should dismiss the tooltip
1428− mouseClick(item, item.width / 2, item.height / 2, Qt.LeftButton)
1429− tryCompare(tooltipShape, "visible", false)
1434+ mouseClick(item, item.width / 2 + 1, item.height / 2, Qt.LeftButton);
1435+ tryCompare(tooltipShape, "visible", false);
1436+
1437+ // Mouse motion should should show tooltip again
1438+ mouseMove(item, item.width / 2, item.height / 2);
1439+ mouseMove(item, item.width / 2 + 1, item.height / 2);
1440+ tryCompare(tooltipShape, "visible", true);
14301441 }
14311442 }
14321443}