~pete-woods/unity-scopes-api/add-system-session-files

« back to all changes in this revision

Viewing changes to test/gtest/scopes/Registry/Registry_test.cpp

  • Committer: Marcus Tomlinson
  • Date: 2016-12-08 07:07:31 UTC
  • mfrom: (694.1.2 create-application-dir)
  • Revision ID: marcus.tomlinson@canonical.com-20161208070731-n23zf1di7ka31q5u
Create $HOME/.local/share/applications if it does not exist.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
    std::condition_variable cond_;
84
84
};
85
85
 
 
86
TEST(Registry, desktop_dir_does_not_exist)
 
87
{
 
88
    // Directory does not exist to start with.
 
89
    EXPECT_FALSE(filesystem::is_directory(TEST_RUNTIME_PATH "/applications"));
 
90
}
 
91
 
86
92
TEST(Registry, metadata)
87
93
{
88
94
    Runtime::UPtr rt = Runtime::create(TEST_RUNTIME_FILE);
156
162
    EXPECT_FALSE(meta.is_aggregator());
157
163
}
158
164
 
 
165
TEST(Registry, desktop_dir_exists)
 
166
{
 
167
    // Directory must have been created.
 
168
    EXPECT_TRUE(filesystem::is_directory(TEST_RUNTIME_PATH "/applications"));
 
169
}
 
170
 
159
171
auto const wait_for_update_time = std::chrono::milliseconds(5000);
160
172
 
161
173
TEST(Registry, scope_state_notify)
694
706
 
695
707
    // Unlink in case we left the link behind from an earlier interrupted run.
696
708
    system::error_code ec;
 
709
    filesystem::remove_all(TEST_RUNTIME_PATH "/applications", ec);
697
710
    filesystem::remove_all(TEST_RUNTIME_PATH "/scopes/testscopeC", ec);
698
711
    filesystem::remove_all(TEST_RUNTIME_PATH "/click",ec);
699
712
    filesystem::remove(TEST_RUNTIME_PATH "/scopes/testscopeD", ec);
701
714
    filesystem::remove(TEST_RUNTIME_PATH "/scopes/testscopeB/testscopeB-settings.ini", ec);
702
715
 
703
716
    // Set the "TEST_DESKTOP_FILES_DIR" env var before forking as not to create desktop files in ~/.local
704
 
    putenv(const_cast<char*>("TEST_DESKTOP_FILES_DIR=" TEST_RUNTIME_PATH));
 
717
    putenv(const_cast<char*>("TEST_DESKTOP_FILES_DIR=" TEST_RUNTIME_PATH "/applications"));
705
718
 
706
719
    auto rpid = fork();
707
720
    if (rpid == 0)