~online-accounts/signon-plugin-digest/upstream

« back to all changes in this revision

Viewing changes to tests/digestplugintest.h

  • Committer: Tomi Suviola
  • Date: 2010-08-02 12:43:31 UTC
  • Revision ID: git-v1:2ea850aa1cc9c9cbf6613e08618a35dbb9e94690
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 
2
/*
 
3
 * This file is part of signon
 
4
 *
 
5
 * Copyright (C) 2009-2010 Nokia Corporation.
 
6
 *
 
7
 * Contact: Alberto Mardegan <alberto.mardegan@nokia.com>
 
8
 *
 
9
 * This library is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU Lesser General Public License
 
11
 * version 2.1 as published by the Free Software Foundation.
 
12
 *
 
13
 * This library is distributed in the hope that it will be useful, but
 
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
16
 * Lesser General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU Lesser General Public
 
19
 * License along with this library; if not, write to the Free Software
 
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
21
 * 02110-1301 USA
 
22
 */
 
23
 
 
24
#ifndef PASSWORD_PLUGIN_TEST
 
25
#define PASSWORD_PLUGIN_TEST
 
26
 
 
27
#include <QString>
 
28
#include "digestplugin.h"
 
29
#include "digestdata.h"
 
30
 
 
31
using namespace DigestPluginNS;
 
32
 
 
33
class DigestPluginTest : public QObject
 
34
{
 
35
    Q_OBJECT
 
36
 
 
37
public slots:
 
38
    void result(const SignOn::SessionData& data);
 
39
    void pluginError(const SignOn::Error &err);
 
40
    void uiRequest(const SignOn::UiSessionData& data);
 
41
 
 
42
private slots:
 
43
    void initTestCase();
 
44
    void cleanupTestCase();
 
45
    void init();
 
46
    void cleanup();
 
47
 
 
48
    //test cases
 
49
    void testPlugin();
 
50
    void testPluginType();
 
51
    void testPluginMechanisms();
 
52
    void testPluginCancel();
 
53
    void testPluginProcess();
 
54
    void testPluginUserActionFinished();
 
55
    void testPluginRefresh();
 
56
    void testMd5();
 
57
    void testNonce();
 
58
    //end test cases
 
59
 
 
60
private:
 
61
    DigestPlugin* m_testPlugin;
 
62
    int m_error;
 
63
    DigestData m_response;
 
64
    SignOn::UiSessionData m_uiResponse;
 
65
    QEventLoop m_loop;
 
66
};
 
67
 
 
68
 
 
69
#endif //PASSWORD_PLUGIN_TEST