Url dialog now supports flag loading.

a=asa for QA checkins that are not part of the default builds
This commit is contained in:
depstein%netscape.com 2002-06-12 18:44:48 +00:00
Родитель 4bf6059ba4
Коммит 9dc2d6fd9d
6 изменённых файлов: 88 добавлений и 39 удалений

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

@ -257,7 +257,6 @@ CTests::~CTests()
void CTests::OnTestsChangeUrl()
{
char *theUrl = "http://www.aol.com/";
CUrlDialog myDialog;
//nsresult rv;
@ -271,14 +270,14 @@ void CTests::OnTestsChangeUrl()
if (myDialog.DoModal() == IDOK)
{
QAOutput("Begin Change URL test.", 1);
strcpy(theUrl, myDialog.m_urlfield);
rv = qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(),
nsIWebNavigation::LOAD_FLAGS_NONE,
rv = qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(myDialog.m_urlfield).get(),
myDialog.m_flagvalue,
nsnull,
nsnull,
nsnull);
RvTestResult(rv, "rv LoadURI() test", 1);
FormatAndPrintOutput("The url = ", theUrl, 2);
FormatAndPrintOutput("The url = ", myDialog.m_urlfield, 2);
FormatAndPrintOutput("The flag = ", myDialog.m_flagvalue, 2);
QAOutput("End Change URL test.", 1);
}
else

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

@ -4,6 +4,7 @@
#include "stdafx.h"
#include "Testembed.h"
#include "UrlDialog.h"
#include "QaUtils.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@ -20,7 +21,9 @@ CUrlDialog::CUrlDialog(CWnd* pParent /*=NULL*/)
{
//{{AFX_DATA_INIT(CUrlDialog)
m_urlfield = _T("");
m_urlflag = 0;
m_flagvalue = 0;
m_flagIndex = -1;
m_chkValue = FALSE;
//}}AFX_DATA_INIT
}
@ -29,8 +32,11 @@ void CUrlDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CUrlDialog)
DDX_Control(pDX, IDC_CHKURLFLAG, m_chkFlags);
DDX_Control(pDX, IDC_COMBO1, m_urlflags);
DDX_Text(pDX, IDC_URLFIELD, m_urlfield);
DDX_CBIndex(pDX, IDC_COMBO1, m_urlflag);
DDX_CBIndex(pDX, IDC_COMBO1, m_flagIndex);
DDX_Check(pDX, IDC_CHKURLFLAG, m_chkValue);
//}}AFX_DATA_MAP
}
@ -38,8 +44,9 @@ void CUrlDialog::DoDataExchange(CDataExchange* pDX)
BEGIN_MESSAGE_MAP(CUrlDialog, CDialog)
//{{AFX_MSG_MAP(CUrlDialog)
ON_EN_CHANGE(IDC_URLFIELD, OnChangeUrlfield)
ON_BN_CLICKED(IDC_CHKURLFLAG, OnChkurlflag)
ON_EN_CHANGE(IDC_COMBO1, OnChangeUrlfield)
ON_CBN_EDITCHANGE(IDC_COMBO1, OnEditchangeCombo1)
ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@ -57,29 +64,66 @@ void CUrlDialog::OnChangeUrlfield()
}
int CUrlDialog::OnEditchangeCombo1()
void CUrlDialog::OnChkurlflag()
{
// TODO: Add your control notification handler code here
int loadFlag = 0;
/*
if (m_urlflag == NONE);
loadFlag = nsIWebNavigation::LOAD_FLAGS_NONE;
else if (m_urlflag == MASK);
loadFlag = nsIWebNavigation::LOAD_FLAGS_MASK;
else if (m_urlflag == IS_LINK);
loadFlag = nsIWebNavigation::LOAD_FLAGS_IS_LINK;
else if (m_urlflag == BYPASS_HISTORY);
loadFlag = nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY;
else if (m_urlflag == REPLACE_HISTORY);
loadFlag = nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY;
else if (m_urlflag == BYPASS_CACHE);
loadFlag = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE;
else if (m_urlflag == BYPASS_PROXY);
loadFlag = nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY;
else if (m_urlflag == CHARSET_CHANGE);
loadFlag = nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE;
*/
return loadFlag;
m_chkValue = ! m_chkValue ;
m_urlflags.EnableWindow(m_chkValue);
}
BOOL CUrlDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_flagIndex = 0;
m_urlflags.SetCurSel(m_flagIndex);
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);
}
else if (m_flagIndex == 1) {
QAOutput("Selected MASK flag.", 1);
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_MASK;
}
else if (m_flagIndex == 2) {
QAOutput("Selected IS_LINK flag.", 1);
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_IS_LINK;
}
else if (m_flagIndex == 3) {
QAOutput("Selected BYPASS_HISTORY flag.", 1);
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY;
}
else if (m_flagIndex == 4) {
QAOutput("Selected REPLACE_HISTORY flag.", 1);
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY;
}
else if (m_flagIndex == 5) {
QAOutput("Selected BYPASS_CACHE flag.", 1);
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE;
}
else if (m_flagIndex == 6) {
QAOutput("Selected BYPASS_PROXY flag.", 1);
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY;
}
else if (m_flagIndex == 7) {
QAOutput("Selected CHARSET_CHANGE flag.", 1);
m_flagvalue = nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE;
}
else
QAOutput("NO FLAG!!!.", 1);
}

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

@ -15,12 +15,15 @@ class CUrlDialog : public CDialog
// Construction
public:
CUrlDialog(CWnd* pParent = NULL); // standard constructor
unsigned long m_flagvalue ;
// Dialog Data
//{{AFX_DATA(CUrlDialog)
enum { IDD = IDD_URLDIALOG };
CButton m_chkFlags;
CComboBox m_urlflags;
CString m_urlfield;
int m_urlflag;
int m_flagIndex;
BOOL m_chkValue;
//}}AFX_DATA
@ -37,7 +40,9 @@ protected:
// Generated message map functions
//{{AFX_MSG(CUrlDialog)
afx_msg void OnChangeUrlfield();
afx_msg int OnEditchangeCombo1();
afx_msg void OnChkurlflag();
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeCombo1();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

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

@ -45,6 +45,7 @@
#define IDC_URLFIELD 1023
#define IDC_COMBO1 1025
#define IDC_CHECK1 1027
#define IDC_CHKURLFLAG 1027
#define IDC_MATCH_WHOLE_WORD 1040
#define IDC_MATCH_CASE 1041
#define IDC_WRAP_AROUND 1042

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

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

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

@ -746,10 +746,10 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,131,22,50,14
LTEXT "Enter URL here:",IDC_ENTER_URLTEXT,64,55,71,8
EDITTEXT IDC_URLFIELD,25,68,134,14,ES_AUTOHSCROLL
COMBOBOX IDC_COMBO1,25,29,86,72,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
CONTROL "Select Load Flag:",IDC_CHECK1,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,32,14,80,10
COMBOBOX IDC_COMBO1,25,29,86,72,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
CONTROL "Select Load Flag:",IDC_CHKURLFLAG,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,32,14,80,10
END
IDD_RUNTESTSDLG DIALOG DISCARDABLE 0, 0, 331, 186