Merge lp:~smspillaz/unity/unity.fix_1086762 into lp:unity

Proposed by Sam Spilsbury
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2962
Proposed branch: lp:~smspillaz/unity/unity.fix_1086762
Merge into: lp:unity
Diff against target: 38 lines (+6/-2)
1 file modified
tests/test_panel_style.cpp (+6/-2)
To merge this branch: bzr merge lp:~smspillaz/unity/unity.fix_1086762
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+138118@code.launchpad.net

Commit message

Use g_setenv and g_unsetenv and change the font setting back

Description of the change

Use g_setenv and g_unsetenv and change the font setting back.

Technically setting GSETTINGS_BACKEND=memory should fix this, but it doesn't. No idea why, so at the moment lets just not leave the font in an inconsistent state.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Fine, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/test_panel_style.cpp'
--- tests/test_panel_style.cpp 2012-08-01 17:33:50 +0000
+++ tests/test_panel_style.cpp 2012-12-05 12:11:23 +0000
@@ -43,7 +43,7 @@
4343
44 /* override */ void SetUp()44 /* override */ void SetUp()
45 {45 {
46 g_setenv("GSETTINGS_BACKEND", "memory", TRUE);46 g_setenv ("GSETTINGS_BACKEND", "memory", 1);
4747
48 gsettings = g_settings_new("org.gnome.desktop.wm.preferences");48 gsettings = g_settings_new("org.gnome.desktop.wm.preferences");
49 g_settings_set_string(gsettings, "titlebar-font", TITLEBAR_FONT.c_str());49 g_settings_set_string(gsettings, "titlebar-font", TITLEBAR_FONT.c_str());
@@ -53,7 +53,7 @@
5353
54 /* override */ void TearDown()54 /* override */ void TearDown()
55 {55 {
56 g_setenv("GSETTINGS_BACKEND", "", TRUE);56 g_unsetenv ("GSETTINGS_BACKEND");
57 }57 }
58};58};
5959
@@ -70,12 +70,16 @@
70 signal_received = true;70 signal_received = true;
71 });71 });
7272
73 gchar *old_font = g_settings_get_string(gsettings, "titlebar-font");
73 g_settings_set_string(gsettings, "titlebar-font", "Ubuntu Italic 11");74 g_settings_set_string(gsettings, "titlebar-font", "Ubuntu Italic 11");
7475
75 sleep(1);76 sleep(1);
7677
77 ASSERT_TRUE(signal_received);78 ASSERT_TRUE(signal_received);
78 ASSERT_EQ(panel_style_instance->GetFontDescription(panel::PanelItem::TITLE), "Ubuntu Italic 11"); 79 ASSERT_EQ(panel_style_instance->GetFontDescription(panel::PanelItem::TITLE), "Ubuntu Italic 11");
80
81 g_settings_set_string(gsettings, "titlebar-font", old_font);
82 g_free (old_font);
79}83}
8084
81}85}