diff options
| author | Ugo Riboni <ugo.riboni@canonical.com> | 2012-08-29 13:06:01 +0200 |
|---|---|---|
| committer | Ugo Riboni <ugo.riboni@canonical.com> | 2012-08-29 13:06:01 +0200 |
| commit | 8d3453bbfce4bb65afe3ab76bb7feca08ca79d16 (patch) | |
| tree | e5eab43538312755e9da1f8c00bc0affae2d456a /tests | |
| parent | 3b62439fa2fca264fb2bf82d900dbe9939a9c3ca (diff) | |
| parent | a011109f609567c48ef3c54f04f3d22f544da004 (diff) | |
merge changes from trunk
(bzr r2562.1.17)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/autopilot/unity/emulators/workspace.py | 1 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/test_dash.py | 108 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/test_hud.py | 23 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/test_quicklist.py | 60 | ||||
| -rw-r--r-- | tests/test_previews_application.cpp | 20 | ||||
| -rw-r--r-- | tests/test_previews_generic.cpp | 12 | ||||
| -rw-r--r-- | tests/test_previews_movie.cpp | 12 | ||||
| -rw-r--r-- | tests/test_previews_music.cpp | 10 |
8 files changed, 140 insertions, 106 deletions
diff --git a/tests/autopilot/unity/emulators/workspace.py b/tests/autopilot/unity/emulators/workspace.py index 773b968c1..7b02f10a8 100644 --- a/tests/autopilot/unity/emulators/workspace.py +++ b/tests/autopilot/unity/emulators/workspace.py @@ -10,7 +10,6 @@ from __future__ import absolute_import -from autopilot.globals import global_context from autopilot.keybindings import KeybindingsHelper from autopilot.utilities import ( get_compiz_option, diff --git a/tests/autopilot/unity/tests/test_dash.py b/tests/autopilot/unity/tests/test_dash.py index ab4c5b489..d6e270ee6 100644 --- a/tests/autopilot/unity/tests/test_dash.py +++ b/tests/autopilot/unity/tests/test_dash.py @@ -609,93 +609,97 @@ class CategoryHeaderTests(DashTestCase): self.assertThat(category.is_expanded, Eventually(Equals(is_expanded))) -class PreviewAppLensInvocationTests(DashTestCase): - """Tests that application lens previews can be opened and closed +class PreviewInvocationTests(DashTestCase): + """Tests that dash previews can be opened and closed in different + lenses. + """ - def assertSearchText(self, text): - self.assertThat(self.dash.search_string, Eventually(Equals(text))) + + def test_app_lens_preview_open_close(self): + """Right-clicking on an application lens result must show + its preview. - def test_open_preview_close_preview(self): - """Right clicking on any result shall open a preview, - escaping shall close the preview """ lens = self.dash.reveal_application_lens() self.addCleanup(self.dash.ensure_hidden) category = lens.get_category_by_name("Installed") results = category.get_results() - # wait for a result - refresh_fn = lambda: len(results) - self.assertThat(refresh_fn, Eventually(GreaterThan(0))) - result = results[0] # result.preview handles finding xy co-ords and right mouse-click result.preview() - # revealing a preview may be very slow, not sure if Eventually handles that nicely self.assertThat(self.dash.preview_displaying, Eventually(Equals(True))) self.keyboard.press_and_release("Escape") self.assertThat(self.dash.preview_displaying, Eventually(Equals(False))) - def test_preview_refocus_close(self): - """This tests that if the mouse is clicked on a preview element (Cover art for example), - the keyboard shortcut for closing ('Escape') still works correctly. + def test_files_lens_preview_open_close(self): + """Right-clicking on a files lens result must show its + preview. + """ - lens = self.dash.reveal_application_lens() + lens = self.dash.reveal_file_lens() self.addCleanup(self.dash.ensure_hidden) - category = lens.get_category_by_name("Installed") + category = lens.get_category_by_name("Folders") results = category.get_results() - # wait for a result - refresh_fn = lambda: len(results) - self.assertThat(refresh_fn, Eventually(GreaterThan(0))) - result = results[0] # result.preview handles finding xy co-ords and right mouse-click result.preview() - # revealing a preview may be very slow, not sure if Eventually handles that nicely self.assertThat(self.dash.preview_displaying, Eventually(Equals(True))) - preview_container = self.dash.view.get_preview_container() - # wait for settle. - self.assertThat(preview_container.animating, Eventually(Equals(False))) - cover_art = preview_container.current_preview.cover_art + self.keyboard.press_and_release("Escape") - # click the cover-art (this will set focus) - tx = cover_art.x + (cover_art.width / 2) - ty = cover_art.y + (cover_art.height / 2) - self.mouse.move(tx, ty) - self.mouse.click() + self.assertThat(self.dash.preview_displaying, Eventually(Equals(False))) + + def test_music_lens_preview_open_close(self): + """Right-clicking on a music lens result must show its + preview. + + """ + lens = self.dash.reveal_music_lens() + self.addCleanup(self.dash.ensure_hidden) + + category = lens.get_category_by_name("Songs") + # Incase there was no music ever played we skip the test instead + # of failing. + if category is None: + self.skipTest("This lens is probably empty") + + results = category.get_results() + + result = results[0] + # result.preview handles finding xy co-ords and right mouse-click + result.preview() + self.assertThat(self.dash.preview_displaying, Eventually(Equals(True))) self.keyboard.press_and_release("Escape") self.assertThat(self.dash.preview_displaying, Eventually(Equals(False))) + def test_video_lens_preview_open_close(self): + """Right-clicking on a video lens result must show its + preview. -class PreviewFileLensInvocationTests(DashTestCase): - """Tests that file lens previews can be opened and closed - """ - def assertSearchText(self, text): - self.assertThat(self.dash.search_string, Eventually(Equals(text))) - - def test_open_preview_close_preview(self): - """Right clicking on any result shall open a preview, - escaping shall close the preview """ - lens = self.dash.reveal_file_lens() + lens = self.dash.reveal_video_lens() self.addCleanup(self.dash.ensure_hidden) - category = lens.get_category_by_name("Folders") + category = lens.get_category_by_name("Recently Viewed") + # If there was no video played on this system this category is expected + # to be empty, if its empty we check if the 'Online' category have any + # contents, if not then we skip the test. + if category is None: + category = lens.get_category_by_name("Online") + if category is None: + self.skipTest("This lens is probably empty") + results = category.get_results() - # wait for a result - refresh_fn = lambda: len(results) - self.assertThat(refresh_fn, Eventually(GreaterThan(0))) result = results[0] # result.preview handles finding xy co-ords and right mouse-click result.preview() - # revealing a preview may be very slow, not sure if Eventually handles that nicely self.assertThat(self.dash.preview_displaying, Eventually(Equals(True))) self.keyboard.press_and_release("Escape") @@ -813,5 +817,17 @@ class PreviewNavigateTests(DashTestCase): # if we've navigated right, there should be at least one preview available on left. self.assertThat(self.preview_container.navigate_left_enabled, Eventually(Equals(True))) + def test_preview_refocus_close(self): + """Clicking on a preview element must not lose keyboard focus.""" + cover_art = self.preview_container.current_preview.cover_art + + # click the cover-art (this will set focus) + tx = cover_art.x + (cover_art.width / 2) + ty = cover_art.y + (cover_art.height / 2) + self.mouse.move(tx, ty) + self.mouse.click() + + self.keyboard.press_and_release("Escape") + self.assertThat(self.dash.preview_displaying, Eventually(Equals(False))) diff --git a/tests/autopilot/unity/tests/test_hud.py b/tests/autopilot/unity/tests/test_hud.py index 0fbbf57cf..987a2b580 100644 --- a/tests/autopilot/unity/tests/test_hud.py +++ b/tests/autopilot/unity/tests/test_hud.py @@ -335,6 +335,29 @@ class HudBehaviorTests(HudTestsBase): self.assertThat(file_contents, Equals('ABCD')) + def test_hud_closes_on_item_activated(self): + """Activating a HUD item with the 'Enter' key MUST close the HUD.""" + # starting on a clean desktop because this way we are sure that our search + # string won't match any menu item from a focused application + self.window_manager.enter_show_desktop() + self.addCleanup(self.window_manager.leave_show_desktop) + + self.hud.ensure_visible() + + self.keyboard.type("settings") + self.assertThat(self.hud.search_string, Eventually(Equals("settings"))) + + self.keyboard.press_and_release('Down') + self.assertThat(self.hud.selected_button, Eventually(Equals(2))) + self.keyboard.press_and_release('Down') + self.assertThat(self.hud.selected_button, Eventually(Equals(3))) + self.keyboard.press_and_release('Enter') + + self.addCleanup(self.close_all_app, "System Settings") + + self.assertThat(self.hud.visible, Eventually(Equals(False))) + + class HudLauncherInteractionsTests(HudTestsBase): launcher_modes = [('Launcher autohide', {'launcher_autohide': False}), diff --git a/tests/autopilot/unity/tests/test_quicklist.py b/tests/autopilot/unity/tests/test_quicklist.py index b253fa071..8aa4a3ad2 100644 --- a/tests/autopilot/unity/tests/test_quicklist.py +++ b/tests/autopilot/unity/tests/test_quicklist.py @@ -138,7 +138,7 @@ class QuicklistActionTests(UnityTestCase): calc = self.start_app("Calculator") calc_icon = self.launcher.model.get_icon(desktop_id=calc.desktop_file) - calc_ql = self.open_quicklist_for_icon(calc_icon) + self.open_quicklist_for_icon(calc_icon) self.hud.ensure_visible() self.addCleanup(self.hud.ensure_hidden) @@ -149,7 +149,7 @@ class QuicklistActionTests(UnityTestCase): calc = self.start_app("Calculator") calc_icon = self.launcher.model.get_icon(desktop_id=calc.desktop_file) - calc_ql = self.open_quicklist_for_icon(calc_icon) + self.open_quicklist_for_icon(calc_icon) self.dash.ensure_visible() self.addCleanup(self.dash.ensure_hidden) @@ -212,10 +212,12 @@ class QuicklistKeyNavigationTests(UnityTestCase): """Opens a quicklist with the mouse.""" self.ql_launcher.click_launcher_icon(self.ql_launcher_icon, button=3) self.addCleanup(self.keyboard.press_and_release, "Escape") + self.assertThat(self.ql_launcher_icon.get_quicklist, + Eventually(NotEquals(None))) self.quicklist = self.ql_launcher_icon.get_quicklist() - self.assertThat(self.quicklist, NotEquals(None)) self.quicklist.move_mouse_to_right() - self.assertThat(self.quicklist.selected_item, Equals(None)) + self.assertThat(lambda: self.quicklist.selected_item, + Eventually(Equals(None))) def open_quicklist_with_keyboard(self): """Opens a quicklist using the keyboard.""" @@ -227,9 +229,16 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("launcher/keynav/open-quicklist") self.addCleanup(self.keybinding, "launcher/keynav/close-quicklist") - self.assertThat(self.ql_launcher_icon.get_quicklist, Eventually(NotEquals(None))) + self.assertThat(self.ql_launcher_icon.get_quicklist, + Eventually(NotEquals(None))) self.quicklist = self.ql_launcher_icon.get_quicklist() - self.assertThat(lambda: self.quicklist.selected_item, Eventually(NotEquals(None))) + self.assertThat(lambda: self.quicklist.selected_item, + Eventually(NotEquals(None))) + + def assertCorrectItemSelected(self, item): + """Ensure the item considers itself selected and that quicklist agrees.""" + self.assertThat(item.selected, Eventually(Equals(True))) + self.assertThat(self.quicklist.selected_item.id, Equals(item.id)) def test_keynav_selects_first_item_when_unselected(self): """Home key MUST select the first selectable item in a quicklist.""" @@ -238,8 +247,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/first") expected_item = self.quicklist.selectable_items[0] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_keynav_selects_first_item_when_selected(self): """Home key MUST select the first selectable item in a quicklist when @@ -253,8 +261,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/first") expected_item = self.quicklist.selectable_items[0] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_keynav_next_selects_first_item_when_unselected(self): """Down key MUST select the first valid item when nothing is selected.""" @@ -263,8 +270,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/next") expected_item = self.quicklist.selectable_items[0] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_keynav_selects_last_item_when_unselected(self): """End key MUST select the last selectable item in a quicklist.""" @@ -273,8 +279,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/last") expected_item = self.quicklist.selectable_items[-1] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_keynav_selects_last_item_when_selected(self): """End key MUST select the last selectable item in a quicklist when @@ -288,8 +293,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/last") expected_item = self.quicklist.selectable_items[-1] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_keynav_prev_selects_last_item_when_unselected(self): """Up key MUST select the last valid item when nothing is selected.""" @@ -298,8 +302,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/prev") expected_item = self.quicklist.selectable_items[-1] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_launcher_keynav_selects_first_item(self): """The first selectable item of the quicklist must be selected when @@ -308,8 +311,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.open_quicklist_with_keyboard() expected_item = self.quicklist.selectable_items[0] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_keynav_next_selection_works(self): """Down key MUST select the next valid item.""" @@ -317,8 +319,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): for item in self.quicklist.selectable_items: self.keybinding("quicklist/keynav/next") - self.assertThat(item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(item.id)) + self.assertCorrectItemSelected(item) def test_keynav_prev_selection_works(self): """Up key MUST select the previous valid item.""" @@ -326,8 +327,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): for item in reversed(self.quicklist.selectable_items): self.keybinding("quicklist/keynav/prev") - self.assertThat(item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(item.id)) + self.assertCorrectItemSelected(item) def test_keynav_prev_is_cyclic(self): """Up key MUST select the last item, when the first one is selected.""" @@ -339,8 +339,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/prev") expected_item = self.quicklist.selectable_items[-1] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_keynav_next_is_cyclic(self): """Down key MUST select the first item, when the last one is selected.""" @@ -352,8 +351,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/next") expected_item = self.quicklist.selectable_items[0] - self.assertThat(expected_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(expected_item.id)) + self.assertCorrectItemSelected(expected_item) def test_keynav_mouse_interaction(self): """Tests that the interaction between key-navigation and mouse works as @@ -369,8 +367,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): self.keybinding("quicklist/keynav/prev") key_item = self.quicklist.selectable_items[-3] - self.assertThat(key_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(key_item.id)) + self.assertCorrectItemSelected(key_item) # Moving the mouse horizontally doesn't change the selection self.mouse.move(mouse_item.x + mouse_item.width - 10, mouse_item.y + mouse_item.height / 2) @@ -383,8 +380,7 @@ class QuicklistKeyNavigationTests(UnityTestCase): # Moving the mouse to another entry, changes the selection mouse_item = self.quicklist.selectable_items[-2] mouse_item.mouse_move_to() - self.assertThat(mouse_item.selected, Eventually(Equals(True))) - self.assertThat(self.quicklist.selected_item.id, Equals(mouse_item.id)) + self.assertCorrectItemSelected(mouse_item) def test_moving_mouse_during_grab_select_correct_menuitem(self): """Test that moving the mouse during grabbing selects the diff --git a/tests/test_previews_application.cpp b/tests/test_previews_application.cpp index e5a3adcc1..b98233b49 100644 --- a/tests/test_previews_application.cpp +++ b/tests/test_previews_application.cpp @@ -70,16 +70,16 @@ public: glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_application_preview_new())); unity_protocol_application_preview_set_app_icon(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), g_icon_new_for_string("/home/nick/SkypeIcon.png", NULL)); - unity_protocol_application_preview_set_license(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "License"); - unity_protocol_application_preview_set_copyright(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "Copywrite"); + unity_protocol_application_preview_set_license(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "License & special char"); + unity_protocol_application_preview_set_copyright(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "Copywrite & special char"); unity_protocol_application_preview_set_last_update(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "11th Apr 2012"); unity_protocol_application_preview_set_rating(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), 0.8); unity_protocol_application_preview_set_num_ratings(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), 12); unity_protocol_preview_set_image_source_uri(proto_obj, "http://ia.media-imdb.com/images/M/MV5BMTM3NDM5MzY5Ml5BMl5BanBnXkFtZTcwNjExMDUwOA@@._V1._SY317_.jpg"); - unity_protocol_preview_set_title(proto_obj, "Application Title"); - unity_protocol_preview_set_subtitle(proto_obj, "Application Subtitle"); - unity_protocol_preview_set_description(proto_obj, "Application Desctiption"); + unity_protocol_preview_set_title(proto_obj, "Application Title & special char"); + unity_protocol_preview_set_subtitle(proto_obj, "Application Subtitle > special char"); + unity_protocol_preview_set_description(proto_obj, "Application Desctiption < special char"); unity_protocol_preview_add_action(proto_obj, "action1", "Action 1", NULL, 0); unity_protocol_preview_add_action(proto_obj, "action2", "Action 2", NULL, 0); unity_protocol_preview_add_info_hint(proto_obj, "hint1", "Hint 1", NULL, g_variant_new("s", "string hint 1")); @@ -110,12 +110,12 @@ TEST_F(TestPreviewApplication, TestUIValues) { MockApplicationPreview::Ptr preview_view(new MockApplicationPreview(preview_model_)); - EXPECT_EQ(preview_view->title_->GetText(), "Application Title"); - EXPECT_EQ(preview_view->subtitle_->GetText(), "Application Subtitle"); - EXPECT_EQ(preview_view->description_->GetText(), "Application Desctiption"); - EXPECT_EQ(preview_view->license_->GetText(), "License"); + EXPECT_EQ(preview_view->title_->GetText(), "Application Title & special char"); + EXPECT_EQ(preview_view->subtitle_->GetText(), "Application Subtitle > special char"); + EXPECT_EQ(preview_view->description_->GetText(), "Application Desctiption < special char"); + EXPECT_EQ(preview_view->license_->GetText(), "License & special char"); //EXPECT_EQ(preview_view->last_update_->GetText(), "Last Updated 11th Apr 2012"); // Not 100% sure this will work with translations. - EXPECT_EQ(preview_view->copywrite_->GetText(), "Copywrite"); + EXPECT_EQ(preview_view->copywrite_->GetText(), "Copywrite & special char"); EXPECT_EQ(preview_view->app_rating_->GetRating(), 0.8f); EXPECT_EQ(preview_view->action_buttons_.size(), 2); diff --git a/tests/test_previews_generic.cpp b/tests/test_previews_generic.cpp index a803afa9c..b88020720 100644 --- a/tests/test_previews_generic.cpp +++ b/tests/test_previews_generic.cpp @@ -64,9 +64,9 @@ public: glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_generic_preview_new())); unity_protocol_preview_set_image_source_uri(proto_obj, "http://ia.media-imdb.com/images/M/MV5BMTM3NDM5MzY5Ml5BMl5BanBnXkFtZTcwNjExMDUwOA@@._V1._SY317_.jpg"); - unity_protocol_preview_set_title(proto_obj, "Generic Title"); - unity_protocol_preview_set_subtitle(proto_obj, "Generic Subtitle"); - unity_protocol_preview_set_description(proto_obj, "Generic Desctiption"); + unity_protocol_preview_set_title(proto_obj, "Generic Title & special char"); + unity_protocol_preview_set_subtitle(proto_obj, "Generic Subtitle > special char"); + unity_protocol_preview_set_description(proto_obj, "Generic Desctiption < special char"); unity_protocol_preview_add_action(proto_obj, "action1", "Action 1", NULL, 0); unity_protocol_preview_add_action(proto_obj, "action2", "Action 2", NULL, 0); unity_protocol_preview_add_info_hint(proto_obj, "hint1", "Hint 1", NULL, g_variant_new("s", "string hint 1")); @@ -97,9 +97,9 @@ TEST_F(TestPreviewGeneric, TestUIValues) { MockGenericPreview::Ptr preview_view(new MockGenericPreview(preview_model_)); - EXPECT_EQ(preview_view->title_->GetText(), "Generic Title"); - EXPECT_EQ(preview_view->subtitle_->GetText(), "Generic Subtitle"); - EXPECT_EQ(preview_view->description_->GetText(), "Generic Desctiption"); + EXPECT_EQ(preview_view->title_->GetText(), "Generic Title & special char"); + EXPECT_EQ(preview_view->subtitle_->GetText(), "Generic Subtitle > special char"); + EXPECT_EQ(preview_view->description_->GetText(), "Generic Desctiption < special char"); EXPECT_EQ(preview_view->action_buttons_.size(), 2); } diff --git a/tests/test_previews_movie.cpp b/tests/test_previews_movie.cpp index ae7610bcb..d22a25d07 100644 --- a/tests/test_previews_movie.cpp +++ b/tests/test_previews_movie.cpp @@ -70,9 +70,9 @@ public: unity_protocol_movie_preview_set_num_ratings(UNITY_PROTOCOL_MOVIE_PREVIEW(proto_obj.RawPtr()), 12); unity_protocol_preview_set_image_source_uri(proto_obj, "http://ia.media-imdb.com/images/M/MV5BMTM3NDM5MzY5Ml5BMl5BanBnXkFtZTcwNjExMDUwOA@@._V1._SY317_.jpg"); - unity_protocol_preview_set_title(proto_obj, "Movie Title"); - unity_protocol_preview_set_subtitle(proto_obj, "Movie Subtitle"); - unity_protocol_preview_set_description(proto_obj, "Movie Desctiption"); + unity_protocol_preview_set_title(proto_obj, "Movie Title & special char"); + unity_protocol_preview_set_subtitle(proto_obj, "Movie Subtitle > special char"); + unity_protocol_preview_set_description(proto_obj, "Movie Desctiption < special char"); unity_protocol_preview_add_action(proto_obj, "action1", "Action 1", NULL, 0); unity_protocol_preview_add_action(proto_obj, "action2", "Action 2", NULL, 0); unity_protocol_preview_add_info_hint(proto_obj, "hint1", "Hint 1", NULL, g_variant_new("s", "string hint 1")); @@ -103,9 +103,9 @@ TEST_F(TestPreviewMovie, TestUIValues) { MockMoviePreview::Ptr preview_view(new MockMoviePreview(preview_model_)); - EXPECT_EQ(preview_view->title_->GetText(), "Movie Title"); - EXPECT_EQ(preview_view->subtitle_->GetText(), "Movie Subtitle"); - EXPECT_EQ(preview_view->description_->GetText(), "Movie Desctiption"); + EXPECT_EQ(preview_view->title_->GetText(), "Movie Title & special char"); + EXPECT_EQ(preview_view->subtitle_->GetText(), "Movie Subtitle > special char"); + EXPECT_EQ(preview_view->description_->GetText(), "Movie Desctiption < special char"); EXPECT_EQ(preview_view->rating_->GetRating(), 0.8f); EXPECT_EQ(preview_view->action_buttons_.size(), 2); diff --git a/tests/test_previews_music.cpp b/tests/test_previews_music.cpp index 095bdb261..aa43117ef 100644 --- a/tests/test_previews_music.cpp +++ b/tests/test_previews_music.cpp @@ -65,9 +65,9 @@ public: glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_music_preview_new())); unity_protocol_preview_set_image_source_uri(proto_obj, "http://ia.media-imdb.com/images/M/MV5BMTM3NDM5MzY5Ml5BMl5BanBnXkFtZTcwNjExMDUwOA@@._V1._SY317_.jpg"); - unity_protocol_preview_set_title(proto_obj, "Music Title"); - unity_protocol_preview_set_subtitle(proto_obj, "Music Subtitle"); - unity_protocol_preview_set_description(proto_obj, "Music Desctiption"); + unity_protocol_preview_set_title(proto_obj, "Music Title & special char"); + unity_protocol_preview_set_subtitle(proto_obj, "Music Subtitle > special char"); + unity_protocol_preview_set_description(proto_obj, "Music Desctiption < special char"); unity_protocol_preview_add_action(proto_obj, "action1", "Action 1", NULL, 0); unity_protocol_preview_add_action(proto_obj, "action2", "Action 2", NULL, 0); unity_protocol_preview_add_action(proto_obj, "action3", "Action 3", NULL, 0); @@ -100,8 +100,8 @@ TEST_F(TestPreviewMusic, TestUIValues) { MockMusicPreview::Ptr preview_view(new MockMusicPreview(preview_model_)); - EXPECT_EQ(preview_view->title_->GetText(), "Music Title"); - EXPECT_EQ(preview_view->subtitle_->GetText(), "Music Subtitle"); + EXPECT_EQ(preview_view->title_->GetText(), "Music Title & special char"); + EXPECT_EQ(preview_view->subtitle_->GetText(), "Music Subtitle > special char"); EXPECT_EQ(preview_view->action_buttons_.size(), 4); } |
