2
* Copyright 2013 Canonical Ltd.
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.
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.
13
* You should have received a copy of the GNU General Public License
14
* version 3 along with this program. If not, see
15
* <http://www.gnu.org/licenses/>
17
* Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
21
#include <gtest/gtest.h>
23
#include "PanelView.h"
24
#include "unity-shared/PanelStyle.h"
25
#include "unity-shared/UBusMessages.h"
26
#include "unity-shared/UBusWrapper.h"
27
#include "unity-shared/UnitySettings.h"
28
#include "test_utils.h"
33
class TestPanelView : public testing::Test
36
unity::Settings unity_settings_;
37
unity::panel::Style panel_style_;
38
unity::UBusManager ubus_manager_;
39
nux::ObjectPtr<unity::PanelView> panel_view_;
42
: panel_view_(new unity::PanelView(std::make_shared<unity::indicator::DBusIndicators>()))
47
TEST_F(TestPanelView, StoredDashWidth)
49
auto check_function = [this] (int value) {
50
return panel_view_->GetStoredDashWidth() == value;
56
GVariant* info = g_variant_new(UBUS_OVERLAY_FORMAT_STRING, "dash", TRUE, 0, width, height);
57
ubus_manager_.SendMessage(UBUS_OVERLAY_SHOWN, info);
58
Utils::WaitUntil(std::bind(check_function, width));
62
ubus_manager_.SendMessage(UBUS_DASH_SIZE_CHANGED, g_variant_new("(ii)", width, height));
63
Utils::WaitUntil(std::bind(check_function, width));