1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2012 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Nick Dedekind <nick.dedekind@canonical.com>
20
#include <gtest/gtest.h>
21
#include <gmock/gmock.h>
22
#include <unity-shared/SearchBarSpinner.h>
23
#include <unity-shared/DashStyle.h>
24
#include <unity-shared/UnitySettings.h>
25
#include "test_utils.h"
27
using namespace unity;
32
class TestSearchBar : public ::testing::Test
37
unity::Settings settings;
41
TEST_F(TestSearchBar, TestSearchBarSpinnerTimeout)
43
SearchBarSpinner search_bar;
44
search_bar.SetSpinnerTimeout(50);
45
search_bar.SetState(STATE_SEARCHING);
47
ASSERT_TRUE(search_bar.GetState() == STATE_SEARCHING);
49
Utils::WaitUntilMSec([&search_bar] {return search_bar.GetState() == STATE_READY;}, true, 100);
52
TEST_F(TestSearchBar, TestSearchBarSpinnerNoTimeout)
54
SearchBarSpinner search_bar;
55
search_bar.SetSpinnerTimeout(-1);
56
search_bar.SetState(STATE_SEARCHING);
58
ASSERT_TRUE(search_bar.GetState() == STATE_SEARCHING);
60
Utils::WaitUntilMSec([&search_bar] {return search_bar.GetState() == STATE_READY;}, false, 100);