diff --git a/embedding/qa/testembed/Tests.cpp b/embedding/qa/testembed/Tests.cpp index cc661e4ac11..152ae44abaa 100644 --- a/embedding/qa/testembed/Tests.cpp +++ b/embedding/qa/testembed/Tests.cpp @@ -177,6 +177,7 @@ BEGIN_MESSAGE_MAP(CTests, CWnd) ON_COMMAND(ID_INTERFACES_NSIWEBNAV_GETCANGOBACK, OnInterfacesNsiwebnav) ON_COMMAND(ID_INTERFACES_NSIWEBNAV_GETCANGOFORWARD, OnInterfacesNsiwebnav) ON_COMMAND(ID_INTERFACES_NSIWEBNAV_GETCURRENTURI, OnInterfacesNsiwebnav) + ON_COMMAND(ID_INTERFACES_NSIWEBNAV_GETREFERINGURI, OnInterfacesNsiwebnav) ON_COMMAND(ID_INTERFACES_NSIWEBNAV_GETDOCUMENT, OnInterfacesNsiwebnav) ON_COMMAND(ID_INTERFACES_NSIWEBNAV_GETSESSIONHISTORY, OnInterfacesNsiwebnav) ON_COMMAND(ID_INTERFACES_NSIWEBNAV_GOBACK, OnInterfacesNsiwebnav) diff --git a/embedding/qa/testembed/nsIWebNav.cpp b/embedding/qa/testembed/nsIWebNav.cpp index 477bc9f2ec0..9c343df7dac 100644 --- a/embedding/qa/testembed/nsIWebNav.cpp +++ b/embedding/qa/testembed/nsIWebNav.cpp @@ -129,6 +129,9 @@ void CNsIWebNav::OnStartTests(UINT nMenuID) case ID_INTERFACES_NSIWEBNAV_GETCURRENTURI : GetCurrentURITest(2); break ; + case ID_INTERFACES_NSIWEBNAV_GETREFERINGURI: + GetReferingURITest(2); + break; case ID_INTERFACES_NSIWEBNAV_GETSESSIONHISTORY : GetSHTest(2); break ; @@ -186,6 +189,7 @@ void CNsIWebNav::RunAllTests() // uri test GetCurrentURITest(1); + GetReferingURITest(1); // session history test SetSHTest(1); @@ -421,10 +425,10 @@ void CNsIWebNav::GetDocumentTest(PRInt16 displayMode) void CNsIWebNav::GetCurrentURITest(PRInt16 displayMode) { - nsCOMPtr theUri; + nsCOMPtr theURI; - rv = qaWebNav->GetCurrentURI(getter_AddRefs(theUri)); - if (!theUri) { + rv = qaWebNav->GetCurrentURI(getter_AddRefs(theURI)); + if (!theURI) { QAOutput("We didn't get the URI. Test failed.", 2); return; } @@ -432,7 +436,36 @@ void CNsIWebNav::GetCurrentURITest(PRInt16 displayMode) RvTestResult(rv, "GetCurrentURI() test", displayMode); nsCAutoString uriString; - rv = theUri->GetSpec(uriString); + rv = theURI->GetSpec(uriString); + RvTestResult(rv, "nsIURI::GetSpec() for nsIWebNav test", 1); + + FormatAndPrintOutput("the nsIWebNav uri = ", uriString, displayMode); +} + +void CNsIWebNav::GetReferingURITest(PRInt16 displayMode) +{ + nsCOMPtr theURI; + nsCAutoString uriString; + CUrlDialog myDialog; + if (myDialog.DoModal() == IDOK) + { + uriString = myDialog.m_urlfield; + rv = NS_NewURI(getter_AddRefs(theURI), uriString); + if (theURI) + QAOutput("We GOT the URI.", 1); + else + QAOutput("We DIDN'T GET the URI.", 1); + rv = qaWebNav->GetReferingURI(getter_AddRefs(theURI)); + RvTestResult(rv, "GetReferingURI() test", displayMode); +// rv = qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(myDialog.m_urlfield).get(), +// myDialog.m_flagvalue, theURI, nsnull, nsnull); + } + if (!theURI) { + QAOutput("We didn't get the URI. Test failed.", 2); + return; + } + + rv = theURI->GetSpec(uriString); RvTestResult(rv, "nsIURI::GetSpec() for nsIWebNav test", 1); FormatAndPrintOutput("the nsIWebNav uri = ", uriString, displayMode); diff --git a/embedding/qa/testembed/nsIWebNav.h b/embedding/qa/testembed/nsIWebNav.h index 05592fd4c18..409e4abd7b5 100644 --- a/embedding/qa/testembed/nsIWebNav.h +++ b/embedding/qa/testembed/nsIWebNav.h @@ -78,6 +78,7 @@ public: void StopUriTest(char *, PRUint32, PRInt16); void GetDocumentTest(PRInt16); void GetCurrentURITest(PRInt16); + void GetReferingURITest(PRInt16); void GetSHTest(PRInt16); void SetSHTest(PRInt16); void LoadUriandReload(int); diff --git a/embedding/qa/testembed/resource.h b/embedding/qa/testembed/resource.h index 3f81cd54d51..dd3e0c81c1e 100644 --- a/embedding/qa/testembed/resource.h +++ b/embedding/qa/testembed/resource.h @@ -307,6 +307,7 @@ #define ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUS 33044 #define ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUSTEXT 33045 #define ID_TESTS_ADDTOOLTIPLISTENER 33046 +#define ID_INTERFACES_NSIWEBNAV_GETREFERINGURI 33047 #define ID_CLIPBOARDCMD_PASTE 42789 #define ID_CLIPBOARDCMD_COPYSELECTION 42790 #define ID_CLIPBOARDCMD_SELECTALL 42791 @@ -323,7 +324,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 153 -#define _APS_NEXT_COMMAND_VALUE 33047 +#define _APS_NEXT_COMMAND_VALUE 33048 #define _APS_NEXT_CONTROL_VALUE 1033 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/embedding/qa/testembed/testembed.aps b/embedding/qa/testembed/testembed.aps index 02e135aa24c..68a6a82707b 100644 Binary files a/embedding/qa/testembed/testembed.aps and b/embedding/qa/testembed/testembed.aps differ diff --git a/embedding/qa/testembed/testembed.rc b/embedding/qa/testembed/testembed.rc index 4fbf5c75013..67818fd4166 100644 --- a/embedding/qa/testembed/testembed.rc +++ b/embedding/qa/testembed/testembed.rc @@ -256,6 +256,8 @@ BEGIN MENUITEM "GetCurrentURI", ID_INTERFACES_NSIWEBNAV_GETCURRENTURI + MENUITEM "GetReferingURI", ID_INTERFACES_NSIWEBNAV_GETREFERINGURI + MENUITEM "GetSessionHistory", ID_INTERFACES_NSIWEBNAV_GETSESSIONHISTORY MENUITEM "SetSessionHistory", ID_INTERFACES_NSIWEBNAV_SETSESSIONHISTORY @@ -886,7 +888,7 @@ BEGIN RTEXT "New Name:",IDC_STATIC,7,18,38,8 END -IDD_FINDDLG DIALOG DISCARDABLE 30, 73, 236, 62 +IDD_FINDDLG DIALOG DISCARDABLE 30, 73, 242, 87 STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Find" @@ -894,16 +896,14 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Fi&nd what:",-1,4,8,42,8 EDITTEXT IDC_FIND_EDIT,47,7,128,12,ES_AUTOHSCROLL | WS_GROUP - CONTROL "Match &whole word only",IDC_MATCH_WHOLE_WORD,"Button", - BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,4,26,90,12 CONTROL "Wra&p around",IDC_WRAP_AROUND,"Button",BS_AUTOCHECKBOX | - WS_GROUP | WS_TABSTOP,101,26,65,12 + WS_GROUP | WS_TABSTOP,47,44,65,12 CONTROL "Match &case",IDC_MATCH_CASE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,4,42,64,12 + WS_TABSTOP,47,26,64,12 CONTROL "Search &backwards",IDC_SEARCH_BACKWARDS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,101,42,67,12 - DEFPUSHBUTTON "&Find Next",IDOK,182,5,50,14,WS_GROUP - PUSHBUTTON "Cancel",IDCANCEL,182,23,50,14 + BS_AUTOCHECKBOX | WS_TABSTOP,47,62,75,12 + DEFPUSHBUTTON "&Find Next",IDOK,188,5,50,14,WS_GROUP + PUSHBUTTON "Cancel",IDCANCEL,188,23,50,14 END IDD_PRINT_PROGRESS_DIALOG DIALOG DISCARDABLE 0, 0, 294, 55 @@ -1069,6 +1069,12 @@ BEGIN BOTTOMMARGIN, 69 END + IDD_FINDDLG, DIALOG + BEGIN + RIGHTMARGIN, 238 + BOTTOMMARGIN, 62 + END + IDD_PRINT_PROGRESS_DIALOG, DIALOG BEGIN LEFTMARGIN, 7