~ted/ubuntu-app-launch/api-sanity-checker

« back to all changes in this revision

Viewing changes to tests/application-info-desktop.cpp

  • Committer: Bileto Bot
  • Author(s): Rodney Dawes
  • Date: 2016-08-17 15:24:30 UTC
  • mfrom: (237.3.2 add-desktop-apis)
  • Revision ID: ci-train-bot@canonical.com-20160817152430-qcmc4igy9p9mydfi
Add desktop info fields needed for applications scope

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    EXPECT_EQ("Foo App", appinfo.name().value());
65
65
    EXPECT_EQ("", appinfo.description().value());
66
66
    EXPECT_EQ("/foo.png", appinfo.iconPath().value());
 
67
    EXPECT_EQ("", appinfo.defaultDepartment().value());
67
68
 
68
69
    EXPECT_EQ("", appinfo.splash().title.value());
69
70
    EXPECT_EQ("", appinfo.splash().image.value());
126
127
#endif
127
128
}
128
129
 
 
130
TEST_F(ApplicationInfoDesktop, KeyfileDefaultDepartment)
 
131
{
 
132
    auto keyfile = defaultKeyfile();
 
133
    g_key_file_set_string(keyfile.get(), DESKTOP, "X-Ubuntu-Default-Department-ID", "foo");
 
134
    EXPECT_NO_THROW(ubuntu::app_launch::app_info::Desktop(keyfile, "/"));
 
135
}
 
136
 
 
137
TEST_F(ApplicationInfoDesktop, KeyfileScreenshotPath)
 
138
{
 
139
    auto keyfile = defaultKeyfile();
 
140
    g_key_file_set_string(keyfile.get(), DESKTOP, "X-Screenshot", "foo.png");
 
141
    EXPECT_EQ("/foo.png", ubuntu::app_launch::app_info::Desktop(keyfile, "/").screenshotPath().value());
 
142
}
 
143
 
 
144
TEST_F(ApplicationInfoDesktop, KeyfileKeywords)
 
145
{
 
146
    std::vector<std::string>expectedKeywords{"foo", "bar", "baz"};
 
147
 
 
148
    auto keyfile = defaultKeyfile();
 
149
    g_key_file_set_string(keyfile.get(), DESKTOP, "Keywords", "foo;bar;baz;");
 
150
    EXPECT_EQ(expectedKeywords, ubuntu::app_launch::app_info::Desktop(keyfile, "/").keywords().value());
 
151
}
 
152
 
129
153
TEST_F(ApplicationInfoDesktop, KeyfileShowListEdgeCases)
130
154
{
131
155
  // Not appearing in not show list