diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/smoke-tests/action-buttons.js | 29 | ||||
-rw-r--r-- | test/smoke-tests/eosactionbutton.css | 4 | ||||
-rw-r--r-- | test/test-action-button.c | 32 |
3 files changed, 63 insertions, 2 deletions
diff --git a/test/smoke-tests/action-buttons.js b/test/smoke-tests/action-buttons.js index 5869c83..476912a 100644 --- a/test/smoke-tests/action-buttons.js +++ b/test/smoke-tests/action-buttons.js @@ -29,8 +29,33 @@ const TestApplication = new Lang.Class ({ this._menu.get_style_context().remove_class('dark'); } })); - this._content.add(new Gtk.Label ({label: 'Dark action menu'}), 0, 0, 1, 1); - this._content.add(this._darkSwitch, 0, 1, 1, 1); + this._content.attach(new Gtk.Label ({label: 'Dark action menu'}), 0, 0, 1, 1); + this._content.attach(this._darkSwitch, 1, 0, 1, 1); + + this._content.attach (new Endless.ActionButton({ + name: 'LEFT', + 'icon-id': 'object-select-symbolic', + label: 'LEFT', + 'label-position': Gtk.PositionType.LEFT + }), 0, 1, 1, 1); + this._content.attach (new Endless.ActionButton({ + name: 'TOP', + 'icon-id': 'object-select-symbolic', + label: 'TOP', + 'label-position': Gtk.PositionType.TOP + }), 1, 1, 1, 1); + this._content.attach (new Endless.ActionButton({ + name: 'BOTTOM', + 'icon-id': 'object-select-symbolic', + label: 'BOTTOM', + 'label-position': Gtk.PositionType.BOTTOM + }), 0, 2, 1, 1); + this._content.attach (new Endless.ActionButton({ + name: 'RIGHT', + 'icon-id': 'object-select-symbolic', + label: 'RIGHT', + 'label-position': Gtk.PositionType.RIGHT + }), 1, 2, 1, 1); this._menu = new Endless.ActionMenu ({name: 'menu'}); diff --git a/test/smoke-tests/eosactionbutton.css b/test/smoke-tests/eosactionbutton.css index 7097150..189a15a 100644 --- a/test/smoke-tests/eosactionbutton.css +++ b/test/smoke-tests/eosactionbutton.css @@ -1,5 +1,9 @@ /* ****** ACTION MENU ****** */ +GtkWindow { + background-color: mix(white, black, 0.1); +} + #menu { background-color: mix(white, black, 0.2); border-color: mix(white, black, 0.5); diff --git a/test/test-action-button.c b/test/test-action-button.c index ba30be5..7e4ad15 100644 --- a/test/test-action-button.c +++ b/test/test-action-button.c @@ -157,6 +157,34 @@ test_ab_prop_icon_name (ActionButtonFixture *fixture, } static void +test_ab_get_set_label_position (ActionButtonFixture *fixture, + gconstpointer unused) +{ + GtkPositionType label_pos; + + label_pos = eos_action_button_get_label_position (fixture->button); + g_assert (label_pos == GTK_POS_BOTTOM); + + eos_action_button_set_label_position (fixture->button, GTK_POS_TOP); + label_pos = eos_action_button_get_label_position (fixture->button); + g_assert (label_pos == GTK_POS_TOP); +} + +static void +test_ab_prop_label_position (ActionButtonFixture *fixture, + gconstpointer unused) +{ + GtkPositionType label_pos; + + g_object_get (fixture->button, "label-position", &label_pos, NULL); + g_assert (label_pos == GTK_POS_BOTTOM); + + g_object_set (fixture->button, "label-position", GTK_POS_TOP, NULL); + g_object_get (fixture->button, "label-position", &label_pos, NULL); + g_assert (label_pos == GTK_POS_TOP); +} + +static void test_ab_label_agrees (ActionButtonFixture *fixture, gconstpointer unused) { @@ -189,5 +217,9 @@ add_action_button_tests (void) test_ab_get_set_icon_name); ADD_ACTION_BUTTON_TEST ("/action-button/prop-icon-name", test_ab_prop_icon_name); + ADD_ACTION_BUTTON_TEST ("/action-button/get-set-label-position", + test_ab_get_set_label_position); + ADD_ACTION_BUTTON_TEST ("/action-button/prop-label-position", + test_ab_prop_label_position); ADD_ACTION_BUTTON_TEST ("/action-button/label-agrees", test_ab_label_agrees); } |