testinggtk r432 - trunk/tests



Author: bjornl
Date: Tue Sep  9 13:13:24 2008
New Revision: 432
URL: http://svn.gnome.org/viewvc/testinggtk?rev=432&view=rev

Log:
Test for widget.unparent()'s resetting parents focus child

Modified:
   trunk/tests/test_widget.py

Modified: trunk/tests/test_widget.py
==============================================================================
--- trunk/tests/test_widget.py	(original)
+++ trunk/tests/test_widget.py	Tue Sep  9 13:13:24 2008
@@ -300,6 +300,9 @@
     # win.add(t)
     # t.realize()
 
+######################################################################
+##### Unparenting tests ##############################################
+######################################################################
 def test_unparent():
     '''
     Ensure that unparenting a widget clears its parent.
@@ -347,6 +350,20 @@
     widget.unparent()
     assert widget.get_parent_window()
 
+def test_unparent_clears_parent_focus_child():
+    '''
+    Ensure that unparenting a widget that is its parents focus child,
+    clears that parents focus child attribute.
+    '''
+    widget = gtk.Button()
+    container = gtk.HBox()
+    container.add(widget)
+    container.set_focus_child(widget)
+    widget.unparent()
+    assert not container.get_focus_child()
+    # This is needed not to provoke #551349
+    widget.set_parent(container)
+
 ######################################################################
 ##### Focus and grab tests ###########################################
 ######################################################################



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]