~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2012 Samsung Electronics
 
3
    Copyright (C) 2012 Intel Corporation. All rights reserved.
 
4
 
 
5
    This library is free software; you can redistribute it and/or
 
6
    modify it under the terms of the GNU Lesser General Public
 
7
    License as published by the Free Software Foundation; either
 
8
    version 2.1 of the License, or (at your option) any later version.
 
9
 
 
10
    This library is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
13
    Lesser General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU Lesser General Public License
 
16
    along with this library; if not, write to the Free Software Foundation,
 
17
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
18
*/
 
19
 
 
20
#ifndef EWK2UnitTestBase_h
 
21
#define EWK2UnitTestBase_h
 
22
 
 
23
#include "EWK2UnitTestEnvironment.h"
 
24
#include <EWebKit2.h>
 
25
#include <Ecore.h>
 
26
#include <Ecore_Evas.h>
 
27
#include <Eina.h>
 
28
#include <Evas.h>
 
29
#include <gtest/gtest.h>
 
30
 
 
31
namespace EWK2UnitTest {
 
32
 
 
33
class EWK2UnitTestBase : public ::testing::Test {
 
34
public:
 
35
    Ecore_Evas* backingStore() { return m_ecoreEvas; }
 
36
    Evas* canvas() { return ecore_evas_get(m_ecoreEvas); }
 
37
    Evas_Object* webView() { return m_webView; }
 
38
    Ewk_View_Smart_Class* ewkViewClass() { return &m_ewkViewClass; }
 
39
 
 
40
protected:
 
41
    EWK2UnitTestBase();
 
42
 
 
43
    virtual void SetUp();
 
44
    virtual void TearDown();
 
45
 
 
46
    static const double defaultTimeoutSeconds = 10.0;
 
47
 
 
48
    bool loadUrlSync(const char* url, double timeoutSeconds = defaultTimeoutSeconds);
 
49
    bool waitUntilLoadFinished(double timeoutSeconds = defaultTimeoutSeconds);
 
50
    bool waitUntilTitleChangedTo(const char* expectedTitle, double timeoutSeconds = defaultTimeoutSeconds);
 
51
    bool waitUntilURLChangedTo(const char* expectedURL, double timeoutSeconds = defaultTimeoutSeconds);
 
52
 
 
53
    void mouseClick(int x, int y, int button = 1 /*Left*/);
 
54
    void mouseDown(int x, int y, int button = 1 /*Left*/);
 
55
    void mouseUp(int x, int y, int button = 1 /*Left*/);
 
56
    void mouseMove(int x, int y);
 
57
    void multiDown(int id, int x, int y);
 
58
    void multiUp(int id, int x, int y);
 
59
    void multiMove(int id, int x, int y);
 
60
 
 
61
private:
 
62
    Evas_Object* m_webView;
 
63
    Ecore_Evas* m_ecoreEvas;
 
64
    Ewk_View_Smart_Class m_ewkViewClass;
 
65
};
 
66
 
 
67
} // namespace EWK2UnitTest
 
68
 
 
69
#endif // EWK2UnitTestBase_h