The PRIMARY clipboard should be set when the MOUSE selects some text, and should be pasted on MOUSE middle-click ONLY.
The CLIPBOARD clipboard is used for menu entries, and Ctrl+[cxv] shortcuts.
This needs to be fixed, for a couple of reasons. First, we don't have a test that verifies that Ctrl+a works. So your test should be something like this:
50 + def test_paste_crash(self):
51 + """ This test is for this bug:926793 """
52 + self.dash.ensure_hidden()
53 + self.dash.toggle_reveal()
54 +
55 + kb = Keyboard();
56 + kb.type("SegFault")
57 + sleep(1)
58 +
59 + kb.press_and_release("Ctrl+a")
kb.press_and_release("Delete")
63 + searchbar = self.dash.get_searchbar()
64 + self.assertEqual(searchbar.search_string, u'')
Secondly, you need to verify that Ctrl+C actually does something. If both Ctrl+C and Ctrl+V stopped working, your test would still pass. So how about somethingt like this:
Finally, we need to do something similar with the PRIMARY clipboard.
You can put something onto the clipboard artificiall with this code:
from gtk import Clipboard
cb = Clipboard(selection="PRIMARY") # can also be "CLIPBOARD", but we can test that easily enough as it is
cb.set_text("Hello World")
.. at this point, middle mouse clicking will paste "Hello World"
Hi,
First, the standard for clipboard is here: http:// www.freedesktop .org/wiki/ Specifications/ ClipboardsWiki? action= show&redirect= Standards% 2FClipboardsWik i
The PRIMARY clipboard should be set when the MOUSE selects some text, and should be pasted on MOUSE middle-click ONLY.
The CLIPBOARD clipboard is used for menu entries, and Ctrl+[cxv] shortcuts.
Regarding your first test:
50 + def test_paste_ crash(self) : ensure_ hidden( ) toggle_ reveal( ) and_release( "Ctrl+a" ) and_release( "Ctrl+c" ) and_release( "Ctrl+v" ) get_searchbar( ) l(searchbar. search_ string, u'SegFault')
51 + """ This test is for this bug:926793 """
52 + self.dash.
53 + self.dash.
54 +
55 + kb = Keyboard();
56 + kb.type("SegFault")
57 + sleep(1)
58 +
59 + kb.press_
60 + kb.press_
61 + kb.press_
62 +
63 + searchbar = self.dash.
64 + self.assertEqua
This needs to be fixed, for a couple of reasons. First, we don't have a test that verifies that Ctrl+a works. So your test should be something like this:
50 + def test_paste_ crash(self) : ensure_ hidden( ) toggle_ reveal( ) and_release( "Ctrl+a" ) and_release( "Delete" ) get_searchbar( ) l(searchbar. search_ string, u'')
51 + """ This test is for this bug:926793 """
52 + self.dash.
53 + self.dash.
54 +
55 + kb = Keyboard();
56 + kb.type("SegFault")
57 + sleep(1)
58 +
59 + kb.press_
kb.press_
63 + searchbar = self.dash.
64 + self.assertEqua
Secondly, you need to verify that Ctrl+C actually does something. If both Ctrl+C and Ctrl+V stopped working, your test would still pass. So how about somethingt like this:
50 + def test_paste_ crash(self) : ensure_ hidden( ) toggle_ reveal( ) and_release( "Ctrl+a" ) and_release( "Ctrl+c" ) and_release( "Ctrl+v" ) and_release( "Ctrl+v" ) get_searchbar( ) l(searchbar. search_ string, u'SegFaultSegfa ult')
51 + """ This test is for this bug:926793 """
52 + self.dash.
53 + self.dash.
54 +
55 + kb = Keyboard();
56 + kb.type("SegFault")
57 + sleep(1)
58 +
59 + kb.press_
60 + kb.press_
60 + kb.press_
60 + kb.press_
62 +
63 + searchbar = self.dash.
64 + self.assertEqua
We also need to test Ctrl+x (I assume we're supposed to support that):
50 + def test_paste_ crash(self) : ensure_ hidden( ) toggle_ reveal( ) and_release( "Ctrl+a" ) and_release( "Ctrl+x" ) get_searchbar( ) l(searchbar. search_ string, u'')
51 + """ This test is for this bug:926793 """
52 + self.dash.
53 + self.dash.
54 +
55 + kb = Keyboard();
56 + kb.type("SegFault")
57 + sleep(1)
58 +
59 + kb.press_
60 + kb.press_
62 +
63 + searchbar = self.dash.
64 + self.assertEqua
...and also:
50 + def test_paste_ crash(self) : ensure_ hidden( ) toggle_ reveal( ) and_release( "Ctrl+a" ) and_release( "Ctrl+x" ) and_release( "Ctrl+v" ) and_release( "Ctrl+v" ) get_searchbar( ) l(searchbar. search_ string, u'SegFaultSegfa ult')
51 + """ This test is for this bug:926793 """
52 + self.dash.
53 + self.dash.
54 +
55 + kb = Keyboard();
56 + kb.type("SegFault")
57 + sleep(1)
58 +
59 + kb.press_
60 + kb.press_
60 + kb.press_
60 + kb.press_
62 +
63 + searchbar = self.dash.
64 + self.assertEqua
Finally, we need to do something similar with the PRIMARY clipboard.
You can put something onto the clipboard artificiall with this code:
from gtk import Clipboard selection= "PRIMARY" ) # can also be "CLIPBOARD", but we can test that easily enough as it is
cb = Clipboard(
cb.set_text("Hello World")
.. at this point, middle mouse clicking will paste "Hello World"
More info here:
http:// developer. gnome.org/ pygtk/stable/ class-gtkclipbo ard.html