Exemplo n.º 1
0
void WebTestCase::HistoryEnable()
{
    LoadUrl();
    m_browser->EnableHistory(false);

    CPPUNIT_ASSERT(!m_browser->CanGoForward());
    CPPUNIT_ASSERT(!m_browser->CanGoBack());

    LoadUrl();

    CPPUNIT_ASSERT(!m_browser->CanGoForward());
    CPPUNIT_ASSERT(!m_browser->CanGoBack());
}
void CMFCMDIPrintPreviewView::OnInitialUpdate() 
{
  CView::OnInitialUpdate();
  if (!GetDocument()->GetPathName().IsEmpty()){
    GetDocument()->m_bLoadedDocument = LoadUrl(GetDocument()->GetPathName());
  }
}
Exemplo n.º 3
0
void WebTestCase::Url()
{
    CPPUNIT_ASSERT_EQUAL("about:blank", m_browser->GetCurrentURL());

    //After first loading about:blank the next in the sequence is about:
    LoadUrl();
    CPPUNIT_ASSERT_EQUAL("about:", m_browser->GetCurrentURL());
}
Exemplo n.º 4
0
void WebTestCase::Title()
{
    CPPUNIT_ASSERT_EQUAL("", m_browser->GetCurrentTitle());

    //Test title after loading raw html
    m_browser->SetPage("<html><title>Title</title><body>Text</body></html>", "");
    ENSURE_LOADED;
    CPPUNIT_ASSERT_EQUAL("Title", m_browser->GetCurrentTitle());

    //Test title after loading a url, we yield to let events process
    LoadUrl();
    CPPUNIT_ASSERT_EQUAL("", m_browser->GetCurrentTitle());
}
Exemplo n.º 5
0
void WebTestCase::HistoryList()
{
    LoadUrl(2);
    m_browser->GoBack();

    CPPUNIT_ASSERT_EQUAL(1, m_browser->GetBackwardHistory().size());
    CPPUNIT_ASSERT_EQUAL(1, m_browser->GetForwardHistory().size());

    m_browser->LoadHistoryItem(m_browser->GetForwardHistory()[0]);

    CPPUNIT_ASSERT(!m_browser->CanGoForward());
    CPPUNIT_ASSERT_EQUAL(2, m_browser->GetBackwardHistory().size());
}
Exemplo n.º 6
0
void CRhodesAppView::LoadUrl(char* aUrl)
	{
		char* url = CanonicalizeURL(aUrl);
		TPtrC8 ptr(reinterpret_cast<const TUint8*>(url));
	    HBufC* buffer = HBufC::NewL(ptr.Length());
	    buffer->Des().Copy(ptr);
	    
	    TPtrC aDescriptor;
		aDescriptor.Set(*buffer);
		
	    LoadUrl(aDescriptor);
	    delete buffer;
	    free(url);
	
	}
Exemplo n.º 7
0
void WebTestCase::HistoryClear()
{
    LoadUrl(2);

    //Now we are in the 'middle' of the history
    m_browser->GoBack();
    ENSURE_LOADED;

    CPPUNIT_ASSERT(m_browser->CanGoForward());
    CPPUNIT_ASSERT(m_browser->CanGoBack());

    m_browser->ClearHistory();

    CPPUNIT_ASSERT(!m_browser->CanGoForward());
    CPPUNIT_ASSERT(!m_browser->CanGoBack());
}
Exemplo n.º 8
0
void WebTestCase::History()
{
    LoadUrl(3);

    CPPUNIT_ASSERT(m_browser->CanGoBack());
    CPPUNIT_ASSERT(!m_browser->CanGoForward());

    m_browser->GoBack();

    CPPUNIT_ASSERT(m_browser->CanGoBack());
    CPPUNIT_ASSERT(m_browser->CanGoForward());

    m_browser->GoBack();
    m_browser->GoBack();

    //We should now be at the start of the history
    CPPUNIT_ASSERT(!m_browser->CanGoBack());
    CPPUNIT_ASSERT(m_browser->CanGoForward());
}