示例#1
0
 def test_escape_hides(self):
     window = QDialog()
     w = WebviewWidget(window)
     window.show()
     w.setFocus(Qt.OtherFocusReason)
     self.assertFalse(window.isHidden())
     QTest.keyClick(w, Qt.Key_Escape)
     self.assertTrue(window.isHidden())
示例#2
0
 def test_escape_hides(self):
     # NOTE: This test doesn't work as it is supposed to.
     window = QDialog()
     w = WebviewWidget(window)
     window.show()
     w.setFocus(Qt.OtherFocusReason)
     self.assertFalse(window.isHidden())
     # This event is sent to the wrong widget. Should be sent to the
     # inner HTML view as focused, but no amount of clicking/ focusing
     # helped, neither did invoking JS handler directly. I'll live with it.
     QTest.keyClick(w, Qt.Key_Escape)
     self.assertTrue(window.isHidden())
示例#3
0
 def test_escape_hides(self):
     # NOTE: This test doesn't work as it is supposed to.
     window = QDialog()
     w = WebviewWidget(window)
     window.show()
     w.setFocus(Qt.OtherFocusReason)
     self.assertFalse(window.isHidden())
     # This event is sent to the wrong widget. Should be sent to the
     # inner HTML view as focused, but no amount of clicking/ focusing
     # helped, neither did invoking JS handler directly. I'll live with it.
     QTest.keyClick(w, Qt.Key_Escape)
     self.assertTrue(window.isHidden())