2
Copyright (C) 2012 Samsung Electronics
3
Copyright (C) 2012 Intel Corporation. All rights reserved.
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.
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.
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
20
#ifndef EWK2UnitTestBase_h
21
#define EWK2UnitTestBase_h
23
#include "EWK2UnitTestEnvironment.h"
26
#include <Ecore_Evas.h>
29
#include <gtest/gtest.h>
31
namespace EWK2UnitTest {
33
class EWK2UnitTestBase : public ::testing::Test {
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; }
44
virtual void TearDown();
46
static const double defaultTimeoutSeconds = 10.0;
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);
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);
62
Evas_Object* m_webView;
63
Ecore_Evas* m_ecoreEvas;
64
Ewk_View_Smart_Class m_ewkViewClass;
67
} // namespace EWK2UnitTest
69
#endif // EWK2UnitTestBase_h