~larryprice/ubuntu-app-launch/better-icon-themes

« back to all changes in this revision

Viewing changes to tests/info-watcher-zg.cpp

  • Committer: Bileto Bot
  • Author(s): Ted Gould
  • Date: 2017-02-15 15:09:51 UTC
  • mfrom: (274.2.17 zg-ordering)
  • Revision ID: ci-train-bot@canonical.com-20170215150951-r736n25rz2vlg68t
Provide a popularity info item and a signal for info updating

Approved by: Charles Kerr

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2017 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3, as published
 
6
 * by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License along
 
14
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authors:
 
17
 *     Ted Gould <ted.gould@canonical.com>
 
18
 */
 
19
 
 
20
#include "info-watcher-zg.h"
 
21
 
 
22
#include "eventually-fixture.h"
 
23
#include "registry-mock.h"
 
24
 
 
25
#include <gmock/gmock.h>
 
26
#include <gtest/gtest.h>
 
27
#include <libdbustest/dbus-test.h>
 
28
 
 
29
class InfoWatcherZg : public EventuallyFixture
 
30
{
 
31
protected:
 
32
    std::shared_ptr<DbusTestService> service;
 
33
    std::shared_ptr<RegistryMock> registry;
 
34
 
 
35
    virtual void SetUp()
 
36
    {
 
37
        service = std::shared_ptr<DbusTestService>(dbus_test_service_new(nullptr),
 
38
                                                   [](DbusTestService* service) { g_clear_object(&service); });
 
39
        dbus_test_service_start_tasks(service.get());
 
40
        registry = std::make_shared<RegistryMock>();
 
41
    }
 
42
 
 
43
    virtual void TearDown()
 
44
    {
 
45
        registry.reset();
 
46
        service.reset();
 
47
    }
 
48
};
 
49
 
 
50
TEST_F(InfoWatcherZg, InitTest)
 
51
{
 
52
    auto watcher = std::make_shared<ubuntu::app_launch::info_watcher::Zeitgeist>(registry);
 
53
 
 
54
    watcher.reset();
 
55
}