Add unit tests for zoom functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -42,6 +42,7 @@ private:
|
|||||||
CPPUNIT_TEST( HistoryList );
|
CPPUNIT_TEST( HistoryList );
|
||||||
CPPUNIT_TEST( Editable );
|
CPPUNIT_TEST( Editable );
|
||||||
CPPUNIT_TEST( Selection );
|
CPPUNIT_TEST( Selection );
|
||||||
|
CPPUNIT_TEST( Zoom );
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
void Title();
|
void Title();
|
||||||
@@ -52,6 +53,7 @@ private:
|
|||||||
void HistoryList();
|
void HistoryList();
|
||||||
void Editable();
|
void Editable();
|
||||||
void Selection();
|
void Selection();
|
||||||
|
void Zoom();
|
||||||
void LoadUrl(const wxString& url, int times = 1);
|
void LoadUrl(const wxString& url, int times = 1);
|
||||||
|
|
||||||
wxWebView* m_browser;
|
wxWebView* m_browser;
|
||||||
@@ -203,4 +205,30 @@ void WebTestCase::Selection()
|
|||||||
CPPUNIT_ASSERT(!m_browser->HasSelection());
|
CPPUNIT_ASSERT(!m_browser->HasSelection());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebTestCase::Zoom()
|
||||||
|
{
|
||||||
|
CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_MEDIUM, m_browser->GetZoom());
|
||||||
|
|
||||||
|
if(m_browser->CanSetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT))
|
||||||
|
{
|
||||||
|
m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TYPE_LAYOUT, m_browser->GetZoomType());
|
||||||
|
|
||||||
|
m_browser->SetZoom(wxWEB_VIEW_ZOOM_TINY);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TINY, m_browser->GetZoom());
|
||||||
|
}
|
||||||
|
|
||||||
|
//Reset the zoom level
|
||||||
|
m_browser->SetZoom(wxWEB_VIEW_ZOOM_MEDIUM);
|
||||||
|
|
||||||
|
if(m_browser->CanSetZoomType(wxWEB_VIEW_ZOOM_TYPE_TEXT))
|
||||||
|
{
|
||||||
|
m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_TEXT);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TYPE_TEXT, m_browser->GetZoomType());
|
||||||
|
|
||||||
|
m_browser->SetZoom(wxWEB_VIEW_ZOOM_TINY);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TINY, m_browser->GetZoom());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif //wxUSE_WEB
|
#endif //wxUSE_WEB
|
||||||
|
Reference in New Issue
Block a user