Added protocol menu to UrlDialog. Hooked up nsIWebBrowserFind to screen dialog output.

a=asa for QA checkins that are not part of the default builds
This commit is contained in:
depstein%netscape.com 2002-10-03 02:42:09 +00:00
Родитель 81d80c2c34
Коммит 4c3bfcc036
9 изменённых файлов: 239 добавлений и 150 удалений

Просмотреть файл

@ -624,11 +624,14 @@ void CTests::OnTestsProtocolHandlerNewURI()
nsCAutoString theStr, retStr;
nsCOMPtr<nsIURI> theOriginalURI;
nsIURI *theReturnURI = nsnull;
const char *theProtocol;
nsCOMPtr<nsIProtocolHandler> protocolHandler;
theStr = myDialog.m_urlfield;
rv = ioService->GetProtocolHandler("http", getter_AddRefs(protocolHandler));
theProtocol = myDialog.m_protocolvalue;
FormatAndPrintOutput("The protocol scheme = ", theProtocol, 1);
rv = ioService->GetProtocolHandler(theProtocol, getter_AddRefs(protocolHandler));
RvTestResult(rv, "ioService->GetProtocolHandler() test", 2);
rv = qaWebNav->GetCurrentURI(getter_AddRefs(theOriginalURI));
if (!protocolHandler) {

Просмотреть файл

@ -37,6 +37,7 @@ void CUrlDialog::DoDataExchange(CDataExchange* pDX)
DDX_Text(pDX, IDC_URLFIELD, m_urlfield);
DDX_CBIndex(pDX, IDC_COMBO1, m_flagIndex);
DDX_Check(pDX, IDC_CHKURLFLAG, m_chkValue);
DDX_Control(pDX, IDC_COMBO2, m_protocol);
//}}AFX_DATA_MAP
}
@ -47,6 +48,7 @@ BEGIN_MESSAGE_MAP(CUrlDialog, CDialog)
ON_BN_CLICKED(IDC_CHKURLFLAG, OnChkurlflag)
ON_EN_CHANGE(IDC_COMBO1, OnChangeUrlfield)
ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
ON_CBN_SELCHANGE(IDC_COMBO2, OnSelchangeCombo2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@ -79,22 +81,20 @@ BOOL CUrlDialog::OnInitDialog()
m_urlflags.EnableWindow(m_chkValue);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CUrlDialog::OnSelchangeCombo1()
{
CString flagvalue;
// m_urlflags.GetLBText(m_flagIndex,flagvalue);
m_flagIndex = m_urlflags.GetCurSel();
// if (flagvalue == "NONE") {
if (m_flagIndex == 0) {
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_NONE;
QAOutput("Selected NONE flag.", 1);
QAOutput("Selected NONE flag.", 1);
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_NONE;
}
else if (m_flagIndex == 1) {
QAOutput("Selected MASK flag.", 1);
@ -131,3 +131,47 @@ void CUrlDialog::OnSelchangeCombo1()
else
QAOutput("NO FLAG!!!.", 1);
}
void CUrlDialog::OnSelchangeCombo2()
{
m_protocolIndex = m_protocol.GetCurSel();
if (m_protocolIndex == 0) {
QAOutput("Selected http protocol.", 1);
m_protocolvalue = "http";
}
else if (m_protocolIndex == 1) {
QAOutput("Selected https protocol.", 1);
m_protocolvalue = "https";
}
else if (m_protocolIndex == 2) {
QAOutput("Selected ftp protocol.", 1);
m_protocolvalue = "ftp";
}
else if (m_protocolIndex == 3) {
QAOutput("Selected file protocol.", 1);
m_protocolvalue = "file";
}
else if (m_protocolIndex == 4) {
QAOutput("Selected javascript protocol.", 1);
m_protocolvalue = "javascript";
}
else if (m_protocolIndex == 5) {
QAOutput("Selected about protocol.", 1);
m_protocolvalue = "about";
}
else if (m_protocolIndex == 6) {
QAOutput("Selected data protocol.", 1);
m_protocolvalue = "data";
}
else if (m_protocolIndex == 7) {
QAOutput("Selected mailto protocol.", 1);
m_protocolvalue = "mailto";
}
else if (m_protocolIndex == 8) {
QAOutput("Selected imap protocol.", 1);
m_protocolvalue = "imap";
}
else
QAOutput("NO PROTOCOL SELECTED!!!.", 1);
}

Просмотреть файл

@ -24,7 +24,10 @@ public:
CComboBox m_urlflags;
CString m_urlfield;
int m_flagIndex;
int m_protocolIndex;
BOOL m_chkValue;
CComboBox m_protocol;
CString m_protocolvalue;
//}}AFX_DATA
@ -44,6 +47,7 @@ protected:
afx_msg void OnChkurlflag();
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeCombo1();
afx_msg void OnSelchangeCombo2();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

Просмотреть файл

@ -69,92 +69,92 @@ CNsIWebBrowser::~CNsIWebBrowser()
}
void CNsIWebBrowser::WBAddListener()
void CNsIWebBrowser::WBAddListener(PRInt16 displayMode)
{
// AddWebBrowserListener
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIContextMenuListener*, qaBrowserImpl))));
rv = qaWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIContextMenuListener));
RvTestResult(rv, "AddWebBrowserListener(). nsIContextMenuListener test", 1);
RvTestResult(rv, "AddWebBrowserListener(). nsIContextMenuListener test", displayMode);
RvTestResultDlg(rv, "AddWebBrowserListener(). nsIContextMenuListener test", true);
}
void CNsIWebBrowser::WBRemoveListener()
void CNsIWebBrowser::WBRemoveListener(PRInt16 displayMode)
{
// RemoveWebBrowserListener
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIContextMenuListener*, qaBrowserImpl))));
rv = qaWebBrowser->RemoveWebBrowserListener(weakling, NS_GET_IID(nsIContextMenuListener));
RvTestResult(rv, "RemoveWebBrowserListener(). nsIContextMenuListener test", 1);
RvTestResult(rv, "RemoveWebBrowserListener(). nsIContextMenuListener test", displayMode);
RvTestResultDlg(rv, "RemoveWebBrowserListener(). nsIContextMenuListener test");
}
void CNsIWebBrowser::WBGetContainerWindow()
void CNsIWebBrowser::WBGetContainerWindow(PRInt16 displayMode)
{
// GetContainerWindow
nsCOMPtr<nsIWebBrowserChrome> qaWebBrowserChrome;
rv = qaWebBrowser->GetContainerWindow(getter_AddRefs(qaWebBrowserChrome));
RvTestResult(rv, "nsIWebBrowser::GetContainerWindow() test", 1);
RvTestResult(rv, "nsIWebBrowser::GetContainerWindow() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowser::GetContainerWindow() test");
if (!qaWebBrowserChrome)
QAOutput("Didn't get web browser chrome object.", 2);
QAOutput("Didn't get web browser chrome object.", displayMode);
else {
rv = qaWebBrowserChrome->ShowAsModal();
RvTestResult(rv, "nsIWebBrowserChrome::ShowAsModal() test", 1);
RvTestResult(rv, "nsIWebBrowserChrome::ShowAsModal() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserChrome::ShowAsModal() test");
}
}
void CNsIWebBrowser::WBSetContainerWindow()
void CNsIWebBrowser::WBSetContainerWindow(PRInt16 displayMode)
{
// SetContainerWindow
rv = qaWebBrowser->SetContainerWindow(qaWebBrowserChrome);
RvTestResult(rv, "nsIWebBrowser::SetContainerWindow() test", 1);
RvTestResult(rv, "nsIWebBrowser::SetContainerWindow() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowser::SetContainerWindow() test");
}
void CNsIWebBrowser::WBGetURIContentListener()
void CNsIWebBrowser::WBGetURIContentListener(PRInt16 displayMode)
{
// GetParentURIContentListener
rv = qaWebBrowser->GetParentURIContentListener(getter_AddRefs(qaURIContentListener));
RvTestResult(rv, "nsIWebBrowser::GetParentURIContentListener() test", 1);
RvTestResult(rv, "nsIWebBrowser::GetParentURIContentListener() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowser::GetParentURIContentListener() test");
if (!qaURIContentListener)
QAOutput("Didn't get uri content listener object.", 2);
QAOutput("Didn't get uri content listener object.", displayMode);
else {
nsCOMPtr<nsISupports> qaSupports;
rv = qaURIContentListener->GetLoadCookie(getter_AddRefs(qaSupports));
RvTestResult(rv, "nsIURIContentListener::GetLoadCookie() test", 1);
RvTestResult(rv, "nsIURIContentListener::GetLoadCookie() test", displayMode);
RvTestResultDlg(rv, "nsIURIContentListener::GetLoadCookie() test");
}
}
void CNsIWebBrowser::WBSetURIContentListener()
void CNsIWebBrowser::WBSetURIContentListener(PRInt16 displayMode)
{
// SetParentURIContentListener
rv = qaWebBrowser->SetParentURIContentListener(qaURIContentListener);
RvTestResult(rv, "nsIWebBrowser::SetParentURIContentListener() test", 1);
RvTestResult(rv, "nsIWebBrowser::SetParentURIContentListener() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowser::SetParentURIContentListener() test");
if (!qaURIContentListener)
QAOutput("Didn't get uri content listener object.", 2);
QAOutput("Didn't get uri content listener object.", displayMode);
}
void CNsIWebBrowser::WBGetDOMWindow()
void CNsIWebBrowser::WBGetDOMWindow(PRInt16 displayMode)
{
// GetContentDOMWindow
nsCOMPtr<nsIDOMWindow> qaDOMWindow;
rv = qaWebBrowser->GetContentDOMWindow(getter_AddRefs(qaDOMWindow));
RvTestResult(rv, "nsIWebBrowser::GetContentDOMWindow() test", 1);
RvTestResult(rv, "nsIWebBrowser::GetContentDOMWindow() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowser::GetContentDOMWindow() test");
if (!qaDOMWindow)
QAOutput("Didn't get dom window object.", 2);
QAOutput("Didn't get dom window object.", displayMode);
else {
rv = qaDOMWindow->ScrollTo(50,50);
RvTestResult(rv, "nsIDOMWindow::ScrollTo() test", 1);
RvTestResult(rv, "nsIDOMWindow::ScrollTo() test", displayMode);
RvTestResultDlg(rv, "nsIDOMWindow::ScrollTo() test");
}
}
@ -167,54 +167,54 @@ void CNsIWebBrowser::OnStartTests(UINT nMenuID)
RunAllTests();
break ;
case ID_INTERFACES_NSIWEBBROWSER_ADDWEBBROWSERLISTENER :
WBAddListener();
WBAddListener(2);
break ;
case ID_INTERFACES_NSIWEBBROWSER_REMOVEWEBBROWSERLISTENER :
WBRemoveListener();
WBRemoveListener(2);
break ;
case ID_INTERFACES_NSIWEBBROWSER_GETCONTAINERWINDOW :
WBGetContainerWindow();
WBGetContainerWindow(2);
break ;
case ID_INTERFACES_NSIWEBBROWSER_SETCONTAINERWINDOW :
WBSetContainerWindow();
WBSetContainerWindow(2);
break ;
case ID_INTERFACES_NSIWEBBROWSER_GETPARENTURICONTENTLISTENER :
WBGetURIContentListener();
WBGetURIContentListener(2);
break ;
case ID_INTERFACES_NSIWEBBROWSER_SETPARENTURICONTENTLISTENER :
WBSetURIContentListener();
WBSetURIContentListener(2);
break ;
case ID_INTERFACES_NSIWEBBROWSER_GETCONTENTDOMWINDOW :
WBGetDOMWindow();
WBGetDOMWindow(2);
break ;
case ID_INTERFACES_NSIWEBBROWSER_NSIWBSETUPSETPROPERTY :
WBSSetupProperty();
WBSSetupProperty(2);
break ;
}
}
void CNsIWebBrowser::RunAllTests()
{
WBAddListener();
WBRemoveListener();
WBGetContainerWindow();
WBSetContainerWindow();
WBGetURIContentListener();
WBSetURIContentListener();
WBGetDOMWindow();
WBSSetupProperty();
WBAddListener(1);
WBRemoveListener(1);
WBGetContainerWindow(1);
WBSetContainerWindow(1);
WBGetURIContentListener(1);
WBSetURIContentListener(1);
WBGetDOMWindow(1);
WBSSetupProperty(1);
}
void CNsIWebBrowser::WBSSetupProperty()
void CNsIWebBrowser::WBSSetupProperty(PRInt16 displayMode)
{
// nsIWebBrowserSetup methods
nsCOMPtr <nsIWebBrowserSetup> qaWBSetup(do_QueryInterface(qaWebBrowser, &rv));
RvTestResult(rv, "nsIWebBrowserSetup object test", 1);
RvTestResult(rv, "nsIWebBrowserSetup object test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserSetup object test");
if (!qaWBSetup) {
QAOutput("Didn't get WebBrowser Setup object.", 2);
QAOutput("Didn't get WebBrowser Setup object.", displayMode);
return;
}

Просмотреть файл

@ -71,18 +71,18 @@ public:
CBrowserImpl *qaBrowserImpl;
// local test methods for nsIWebBrowser
void WBAddListener(void);
void WBRemoveListener(void);
void WBGetContainerWindow(void);
void WBSetContainerWindow(void);
void WBGetURIContentListener(void);
void WBSetURIContentListener(void);
void WBGetDOMWindow(void);
void WBAddListener(PRInt16);
void WBRemoveListener(PRInt16);
void WBGetContainerWindow(PRInt16);
void WBSetContainerWindow(PRInt16);
void WBGetURIContentListener(PRInt16);
void WBSetURIContentListener(PRInt16);
void WBGetDOMWindow(PRInt16);
void OnStartTests(UINT nMenuID);
void RunAllTests(void);
void RunAllTests();
// local test methods for nsIWebBrowserSetup
void WBSSetupProperty(void);
void WBSSetupProperty(PRInt16);
// local test variables

Просмотреть файл

@ -81,11 +81,12 @@ nsIWebBrowserFind * CNsIWebBrowFind::GetWebBrowFindObject()
}
else {
RvTestResult(rv, "nsIWebBrowserFind object test", 1);
RvTestResultDlg(rv, "nsIWebBrowserFind object test");
return(qaWBFind);
}
}
void CNsIWebBrowFind::SetSearchStringTest()
void CNsIWebBrowFind::SetSearchStringTest(PRInt16 displayMode)
{
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
@ -96,11 +97,12 @@ void CNsIWebBrowFind::SetSearchStringTest()
// SetSearchString()
searchString.AssignWithConversion(myDialog.m_textfield);
rv = qaWBFind->SetSearchString(searchString.get());
RvTestResult(rv, "nsIWebBrowserFind::SetSearchString() test", 2);
}
RvTestResult(rv, "nsIWebBrowserFind::SetSearchString() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::SetSearchString test");
}
void CNsIWebBrowFind::GetSearchStringTest()
void CNsIWebBrowFind::GetSearchStringTest(PRInt16 displayMode)
{
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
@ -109,12 +111,13 @@ void CNsIWebBrowFind::GetSearchStringTest()
nsXPIDLString stringBuf;
CString csSearchStr;
rv = qaWBFind->GetSearchString(getter_Copies(stringBuf));
RvTestResult(rv, "nsIWebBrowserFind::GetSearchString() test", 2);
RvTestResult(rv, "nsIWebBrowserFind::GetSearchString() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::GetSearchString() test");
csSearchStr = stringBuf.get();
FormatAndPrintOutput("The searched string = ", csSearchStr, 2);
FormatAndPrintOutput("The searched string = ", csSearchStr, displayMode);
}
void CNsIWebBrowFind::FindNextTest(PRBool didFind)
void CNsIWebBrowFind::FindNextTest(PRBool didFind, PRInt16 displayMode)
{
// FindNext()
@ -122,113 +125,124 @@ void CNsIWebBrowFind::FindNextTest(PRBool didFind)
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->FindNext(&didFind);
RvTestResult(rv, "nsIWebBrowserFind::FindNext() object test", 2);
FormatAndPrintOutput("returned didFind = ", didFind, 1);
RvTestResult(rv, "nsIWebBrowserFind::FindNext() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::FindNext() test");
FormatAndPrintOutput("returned didFind = ", didFind, displayMode);
}
void CNsIWebBrowFind::SetFindBackwardsTest(PRBool didFindBackwards)
void CNsIWebBrowFind::SetFindBackwardsTest(PRBool didFindBackwards, PRInt16 displayMode)
{
// SetFindBackwards()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->SetFindBackwards(didFindBackwards);
RvTestResult(rv, "nsIWebBrowserFind::SetFindBackwards() object test", 2);
RvTestResult(rv, "nsIWebBrowserFind::SetFindBackwards() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::SetFindBackwards() test", displayMode);
}
void CNsIWebBrowFind::GetFindBackwardsTest(PRBool didFindBackwards)
void CNsIWebBrowFind::GetFindBackwardsTest(PRBool didFindBackwards, PRInt16 displayMode)
{
// GetFindBackwards()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->GetFindBackwards(&didFindBackwards);
RvTestResult(rv, "nsIWebBrowserFind::GetFindBackwards() object test", 2);
FormatAndPrintOutput("returned didFindBackwards = ", didFindBackwards, 1);
RvTestResult(rv, "nsIWebBrowserFind::GetFindBackwards() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::GetFindBackwards() test");
FormatAndPrintOutput("returned didFindBackwards = ", didFindBackwards, displayMode);
}
void CNsIWebBrowFind::SetWrapFindTest(PRBool didWrapFind)
void CNsIWebBrowFind::SetWrapFindTest(PRBool didWrapFind, PRInt16 displayMode)
{
// SetWrapFind()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->SetWrapFind(didWrapFind);
RvTestResult(rv, "nsIWebBrowserFind::SetWrapFind() object test", 2);
RvTestResult(rv, "nsIWebBrowserFind::SetWrapFind() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::SetWrapFind() test");
}
void CNsIWebBrowFind::GetWrapFindTest(PRBool didWrapFind)
void CNsIWebBrowFind::GetWrapFindTest(PRBool didWrapFind, PRInt16 displayMode)
{
// GetWrapFind()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->GetWrapFind(&didWrapFind);
RvTestResult(rv, "nsIWebBrowserFind::GetWrapFind() object test", 2);
FormatAndPrintOutput("returned didWrapFind = ", didWrapFind, 1);
RvTestResult(rv, "nsIWebBrowserFind::GetWrapFind() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::GetWrapFind() test");
FormatAndPrintOutput("returned didWrapFind = ", didWrapFind, displayMode);
}
void CNsIWebBrowFind::SetEntireWordTest(PRBool didEntireWord)
void CNsIWebBrowFind::SetEntireWordTest(PRBool didEntireWord, PRInt16 displayMode)
{
// SetEntireWord()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->SetEntireWord(didEntireWord);
RvTestResult(rv, "nsIWebBrowserFind::SetEntireWord() object test", 2);
RvTestResult(rv, "nsIWebBrowserFind::SetEntireWord() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::SetEntireWord() test");
}
void CNsIWebBrowFind::GetEntireWordTest(PRBool didEntireWord)
void CNsIWebBrowFind::GetEntireWordTest(PRBool didEntireWord, PRInt16 displayMode)
{
// GetEntireWord()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->GetEntireWord(&didEntireWord);
RvTestResult(rv, "nsIWebBrowserFind::GetEntireWord() object test", 2);
FormatAndPrintOutput("returned didEntireWord = ", didEntireWord, 1);
RvTestResult(rv, "nsIWebBrowserFind::GetEntireWord() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::GetEntireWord() test");
FormatAndPrintOutput("returned didEntireWord = ", didEntireWord, displayMode);
}
void CNsIWebBrowFind::SetMatchCase(PRBool didMatchCase)
void CNsIWebBrowFind::SetMatchCase(PRBool didMatchCase, PRInt16 displayMode)
{
// SetMatchCase()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->SetMatchCase(didMatchCase);
RvTestResult(rv, "nsIWebBrowserFind::SetMatchCase() object test", 2);
RvTestResult(rv, "nsIWebBrowserFind::SetMatchCase() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::SetMatchCase() test");
}
void CNsIWebBrowFind::GetMatchCase(PRBool didMatchCase)
void CNsIWebBrowFind::GetMatchCase(PRBool didMatchCase, PRInt16 displayMode)
{
// GetMatchCase()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->GetMatchCase(&didMatchCase);
RvTestResult(rv, "nsIWebBrowserFind::GetMatchCase() object test", 2);
FormatAndPrintOutput("returned didMatchCase = ", didMatchCase, 1);
RvTestResult(rv, "nsIWebBrowserFind::GetMatchCase() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::GetMatchCase() test");
FormatAndPrintOutput("returned didMatchCase = ", didMatchCase, displayMode);
}
void CNsIWebBrowFind::SetSearchFrames(PRBool didSearchFrames)
void CNsIWebBrowFind::SetSearchFrames(PRBool didSearchFrames, PRInt16 displayMode)
{
// SetSearchFrames()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->SetSearchFrames(didSearchFrames);
RvTestResult(rv, "nsIWebBrowserFind::SetSearchFrames() object test", 2);
RvTestResult(rv, "nsIWebBrowserFind::SetSearchFrames() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::SetSearchFrames() test");
}
void CNsIWebBrowFind::GetSearchFrames(PRBool didSearchFrames)
void CNsIWebBrowFind::GetSearchFrames(PRBool didSearchFrames, PRInt16 displayMode)
{
// GetSearchFrames()
nsCOMPtr<nsIWebBrowserFind> qaWBFind;
qaWBFind = GetWebBrowFindObject();
rv = qaWBFind->GetSearchFrames(&didSearchFrames);
RvTestResult(rv, "nsIWebBrowserFind::GetSearchFrames() object test", 2);
FormatAndPrintOutput("returned didSearchFrames = ", didSearchFrames, 1);
RvTestResult(rv, "nsIWebBrowserFind::GetSearchFrames() test", displayMode);
RvTestResultDlg(rv, "nsIWebBrowserFind::GetSearchFrames() test");
FormatAndPrintOutput("returned didSearchFrames = ", didSearchFrames, displayMode);
}
void CNsIWebBrowFind::OnStartTests(UINT nMenuID)
@ -239,84 +253,86 @@ void CNsIWebBrowFind::OnStartTests(UINT nMenuID)
RunAllTests();
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_SETSEARCHSTRINGTEST :
SetSearchStringTest();
SetSearchStringTest(2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_GETSEARCHSTRINGTEST :
GetSearchStringTest();
GetSearchStringTest(2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_FINDNEXTTEST :
FindNextTest(PR_TRUE);
FindNextTest(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_SETFINDBACKWARDSTEST :
SetFindBackwardsTest(PR_TRUE);
SetFindBackwardsTest(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_GETFINDBACKWARDSTEST :
GetFindBackwardsTest(PR_TRUE);
GetFindBackwardsTest(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_SETWRAPFINDTEST :
SetWrapFindTest(PR_TRUE);
SetWrapFindTest(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_GETWRAPFINDTEST :
GetWrapFindTest(PR_TRUE);
GetWrapFindTest(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_SETENTIREWORDTEST :
SetEntireWordTest(PR_TRUE);
SetEntireWordTest(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_GETENTIREWORDTEST :
GetEntireWordTest(PR_TRUE);
GetEntireWordTest(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_SETMATCHCASE :
SetMatchCase(PR_TRUE);
SetMatchCase(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_GETMATCHCASE :
GetMatchCase(PR_TRUE);
GetMatchCase(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_SETSEARCHFRAMES :
SetSearchFrames(PR_TRUE);
SetSearchFrames(PR_TRUE, 2);
break ;
case ID_INTERFACES_NSIWEBBROWSERFIND_GETSEARCHFRAMES :
GetSearchFrames(PR_TRUE);
GetSearchFrames(PR_TRUE, 2);
break ;
}
}
void CNsIWebBrowFind::RunAllTests()
{
QAOutput("Begin WebBrowserFind tests.", 2);
GetWebBrowFindObject();
SetSearchStringTest();
GetSearchStringTest();
FindNextTest(PR_TRUE);
FindNextTest(PR_TRUE); // run a 2nd time to advance it
SetFindBackwardsTest(PR_TRUE);
GetFindBackwardsTest(PR_TRUE);
FindNextTest(PR_TRUE); // to find backwards
SetWrapFindTest(PR_TRUE);
GetWrapFindTest(PR_TRUE);
FindNextTest(PR_TRUE); // to wrap around
SetEntireWordTest(PR_TRUE);
GetEntireWordTest(PR_TRUE);
FindNextTest(PR_TRUE); // entire word
SetMatchCase(PR_TRUE);
GetMatchCase(PR_TRUE);
FindNextTest(PR_TRUE); // match case
SetSearchFrames(PR_TRUE);
GetSearchFrames(PR_TRUE);
FindNextTest(PR_TRUE); // frames
SetSearchStringTest(1);
GetSearchStringTest(1);
FindNextTest(PR_TRUE, 1);
FindNextTest(PR_TRUE, 1); // run a 2nd time to advance it
SetFindBackwardsTest(PR_TRUE, 1);
GetFindBackwardsTest(PR_TRUE, 1);
FindNextTest(PR_TRUE, 1); // to find backwards
SetWrapFindTest(PR_TRUE, 1);
GetWrapFindTest(PR_TRUE, 1);
FindNextTest(PR_TRUE, 1); // to wrap around
SetEntireWordTest(PR_TRUE, 1);
GetEntireWordTest(PR_TRUE, 1);
FindNextTest(PR_TRUE, 1); // entire word
SetMatchCase(PR_TRUE, 1);
GetMatchCase(PR_TRUE, 1);
FindNextTest(PR_TRUE, 1); // match case
SetSearchFrames(PR_TRUE, 1);
GetSearchFrames(PR_TRUE, 1);
FindNextTest(PR_TRUE, 1); // frames
QAOutput("PR_FALSE tests", 2);
SetFindBackwardsTest(PR_FALSE);
GetFindBackwardsTest(PR_FALSE);
FindNextTest(PR_FALSE); // shouldn't find backwards
SetWrapFindTest(PR_FALSE);
GetWrapFindTest(PR_FALSE);
FindNextTest(PR_FALSE); // shouldn't find wrap around
SetEntireWordTest(PR_FALSE);
GetEntireWordTest(PR_FALSE);
FindNextTest(PR_FALSE); // shouldn't find entire word
SetMatchCase(PR_FALSE);
GetMatchCase(PR_FALSE);
FindNextTest(PR_FALSE); // shouldn't find case
SetSearchFrames(PR_FALSE);
GetSearchFrames(PR_FALSE);
FindNextTest(PR_FALSE); // shouldn't find frame
QAOutput("PR_FALSE tests", 1);
SetFindBackwardsTest(PR_FALSE, 1);
GetFindBackwardsTest(PR_FALSE, 1);
FindNextTest(PR_FALSE, 1); // shouldn't find backwards
SetWrapFindTest(PR_FALSE, 1);
GetWrapFindTest(PR_FALSE, 1);
FindNextTest(PR_FALSE, 1); // shouldn't find wrap around
SetEntireWordTest(PR_FALSE, 1);
GetEntireWordTest(PR_FALSE, 1);
FindNextTest(PR_FALSE, 1); // shouldn't find entire word
SetMatchCase(PR_FALSE, 1);
GetMatchCase(PR_FALSE, 1);
FindNextTest(PR_FALSE, 1); // shouldn't find case
SetSearchFrames(PR_FALSE, 1);
GetSearchFrames(PR_FALSE, 1);
FindNextTest(PR_FALSE, 1); // shouldn't find frame
QAOutput("End WebBrowserFind tests.", 2);
}

Просмотреть файл

@ -75,19 +75,19 @@ public:
// local test methods for nsIWebBrowser
nsIWebBrowserFind * GetWebBrowFindObject();
void SetSearchStringTest();
void GetSearchStringTest();
void FindNextTest(PRBool);
void SetFindBackwardsTest(PRBool);
void GetFindBackwardsTest(PRBool);
void SetWrapFindTest(PRBool);
void GetWrapFindTest(PRBool);
void SetEntireWordTest(PRBool);
void GetEntireWordTest(PRBool);
void SetMatchCase(PRBool);
void GetMatchCase(PRBool);
void SetSearchFrames(PRBool);
void GetSearchFrames(PRBool);
void SetSearchStringTest(PRInt16);
void GetSearchStringTest(PRInt16);
void FindNextTest(PRBool, PRInt16);
void SetFindBackwardsTest(PRBool, PRInt16);
void GetFindBackwardsTest(PRBool, PRInt16);
void SetWrapFindTest(PRBool, PRInt16);
void GetWrapFindTest(PRBool, PRInt16);
void SetEntireWordTest(PRBool, PRInt16);
void GetEntireWordTest(PRBool, PRInt16);
void SetMatchCase(PRBool, PRInt16);
void GetMatchCase(PRBool, PRInt16);
void SetSearchFrames(PRBool, PRInt16);
void GetSearchFrames(PRBool, PRInt16);
void OnStartTests(UINT nMenuID);
void RunAllTests();

Двоичные данные
embedding/qa/testembed/testembed.aps

Двоичный файл не отображается.

Просмотреть файл

@ -856,7 +856,7 @@ BEGIN
EDITTEXT IDC_EDIT_HOMEPAGE,53,95,211,14,ES_AUTOHSCROLL
END
IDD_URLDIALOG DIALOG DISCARDABLE 0, 0, 186, 95
IDD_URLDIALOG DIALOG DISCARDABLE 0, 0, 209, 130
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "URL Dialog"
FONT 8, "MS Sans Serif"
@ -869,6 +869,9 @@ BEGIN
WS_TABSTOP
CONTROL "Select Load Flag:",IDC_CHKURLFLAG,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,32,14,80,10
LTEXT "Protocol (optional):",IDC_STATIC,51,97,60,8
COMBOBOX IDC_COMBO2,58,109,48,66,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
END
IDD_RUNTESTSDLG DIALOG DISCARDABLE 0, 0, 331, 186
@ -999,8 +1002,9 @@ BEGIN
IDD_URLDIALOG, DIALOG
BEGIN
LEFTMARGIN, 6
RIGHTMARGIN, 186
TOPMARGIN, 7
BOTTOMMARGIN, 88
BOTTOMMARGIN, 123
END
IDD_RUNTESTSDLG, DIALOG
@ -1055,6 +1059,24 @@ BEGIN
0x4843, 0x5241, 0x4553, 0x5f54, 0x4843, 0x4e41, 0x4547, "\000"
IDC_COMBO1, 0x403, 8, 0
0x4552, 0x5246, 0x5345, 0x0048,
IDC_COMBO2, 0x403, 6, 0
0x7468, 0x7074, 0x0020,
IDC_COMBO2, 0x403, 6, 0
0x7468, 0x7074, 0x0073,
IDC_COMBO2, 0x403, 4, 0
0x7466, 0x0070,
IDC_COMBO2, 0x403, 5, 0
0x6966, 0x656c, "\000"
IDC_COMBO2, 0x403, 11, 0
0x616a, 0x6176, 0x6373, 0x6972, 0x7470, "\000"
IDC_COMBO2, 0x403, 6, 0
0x6261, 0x756f, 0x0074,
IDC_COMBO2, 0x403, 5, 0
0x6164, 0x6174, "\000"
IDC_COMBO2, 0x403, 7, 0
0x616d, 0x6c69, 0x6f74, "\000"
IDC_COMBO2, 0x403, 5, 0
0x6d69, 0x7061, "\000"
0
END