diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/CBrowseDlg.cpp b/mozilla/webshell/embed/ActiveX/tests/cbrowse/CBrowseDlg.cpp index ebb8425ba33..d427893be64 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/CBrowseDlg.cpp +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/CBrowseDlg.cpp @@ -29,6 +29,7 @@ void __cdecl fperr(int sig) TCHAR *aURLs[] = { + _T("http://whippy/calendar.html"), _T("http://www.mozilla.org"), _T("http://www.yahoo.com"), _T("http://www.netscape.com"), @@ -236,8 +237,10 @@ void CBrowseDlg::OnGo() IWebBrowser *pIWebBrowser = NULL; if (SUCCEEDED(GetWebBrowser(&pIWebBrowser))) { - int nItem = m_cmbURLs.GetCurSel(); - CString szURL = (nItem == 0) ? m_szTestURL : aURLs[nItem - 1]; + CString szURL; + m_cmbURLs.GetWindowText(szURL); +// int nItem = m_cmbURLs.GetCurSel(); +// CString szURL = (nItem == 0) ? m_szTestURL : aURLs[nItem - 1]; BSTR bstrURL = szURL.AllocSysString(); pIWebBrowser->Navigate(bstrURL, NULL, NULL, NULL, NULL); diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/Cbrowse.idl b/mozilla/webshell/embed/ActiveX/tests/cbrowse/Cbrowse.idl new file mode 100644 index 00000000000..b9712522cfe --- /dev/null +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/Cbrowse.idl @@ -0,0 +1,19 @@ + + // Cbrowse.idl : IDL source for Cbrowse.exe +// +// This file will be processed by the MIDL tool to +// produce the type library (Cbrowse.tlb) and marshalling code. +import "oaidl.idl"; +import "ocidl.idl"; +[ + uuid(5B209213-F756-11D2-A27F-000000000000), + version(1.0), + helpstring("Cbrowse 1.0 Type Library") +] +library CbrowseLib +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); +}; + + \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/Cbrowse.rgs b/mozilla/webshell/embed/ActiveX/tests/cbrowse/Cbrowse.rgs new file mode 100644 index 00000000000..e3325c9c8e3 --- /dev/null +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/Cbrowse.rgs @@ -0,0 +1,11 @@ +HKCR +{ + NoRemove AppID + { + {5B209214-F756-11D2-A27F-000000000000} = s 'Cbrowse' + 'Cbrowse.EXE' + { + val AppID = s {5B209214-F756-11D2-A27F-000000000000} + } + } +} diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/StdAfx.cpp b/mozilla/webshell/embed/ActiveX/tests/cbrowse/StdAfx.cpp index 45949ebc8ed..e057645ecbe 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/StdAfx.cpp +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/StdAfx.cpp @@ -7,3 +7,8 @@ #include #include #include + #ifdef _ATL_STATIC_REGISTRY +#include +#endif +#include + diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/StdAfx.h b/mozilla/webshell/embed/ActiveX/tests/cbrowse/StdAfx.h index 78819892c1d..f4f13bce3e1 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/StdAfx.h +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/StdAfx.h @@ -19,6 +19,7 @@ #include // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT +#define _ATL_APARTMENT_THREADED // ATL headers #include //You may derive a class from CComModule and use it if you want to override @@ -29,19 +30,19 @@ extern CComModule _Module; #include #include +#include #include #include #include -// Define some string classes -typedef std::basic_string tstring; - +#include "..\..\ActiveXTypes.h" #include "..\..\BrowserDiagnostics.h" #include "..\..\PropertyList.h" #include "..\..\PropertyBag.h" #include "..\..\ControlSiteIPFrame.h" #include "..\..\ControlSite.h" +#include "..\..\ActiveScriptSite.h" #include "Tests.h" @@ -50,6 +51,7 @@ typedef std::basic_string tstring; #define KEY_TESTURL_DEFAULTVALUE _T("http://www.mozilla.org") + //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/Tests.cpp b/mozilla/webshell/embed/ActiveX/tests/cbrowse/Tests.cpp index fb24632f241..e9a84874194 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/Tests.cpp +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/Tests.cpp @@ -319,6 +319,22 @@ TestResult __cdecl tstNavigate2(BrowserInfo &cInfo) return trFailed; } +TestResult __cdecl tstScriptTest(BrowserInfo &cInfo) +{ + CActiveScriptSiteInstance *pSite = NULL; + CActiveScriptSiteInstance::CreateInstance(&pSite); + + if (pSite) + { + pSite->AddRef(); + pSite->AttachVBScript(); + pSite->ParseScriptText(_T("i=1")); + pSite->PlayScript(); + pSite->Release(); + } + return trPassed; +} + /////////////////////////////////////////////////////////////////////////////// Test aBasic[] = @@ -347,12 +363,18 @@ Test aOther[] = { _T("Print Page"), _T("Print the test URL page"), NULL } }; +Test aScripts[] = +{ + { _T("Script test"), _T("Test that the scripting engine is sane"), tstScriptTest } +}; + TestSet aTestSets[] = { { _T("Basic"), _T("Basic sanity tests"), 5, aBasic }, { _T("Browsing"), _T("Browsing and navigation tests"), 1, aBrowsing }, { _T("DHTML"), _T("Test the DOM"), 3, aDHTML }, - { _T("Other"), _T("Other tests"), 1, aOther } + { _T("Other"), _T("Other tests"), 1, aOther }, + { _T("Scripts"), _T("Script tests"), 1, aScripts } }; int nTestSets = sizeof(aTestSets) / sizeof(aTestSets[0]); \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.cpp b/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.cpp index c8df26a2fea..28306136258 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.cpp +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.cpp @@ -5,6 +5,8 @@ #include "cbrowse.h" #include "CBrowseDlg.h" #include "PickerDlg.h" +#include +#include "Cbrowse_i.c" #ifdef _DEBUG #define new DEBUG_NEW @@ -12,8 +14,6 @@ static char THIS_FILE[] = __FILE__; #endif -CComModule _Module; - ///////////////////////////////////////////////////////////////////////////// // CBrowseApp @@ -49,7 +49,13 @@ BOOL CBrowseApp::InitInstance() { return FALSE; } +/* if (!InitATL()) + return FALSE; */ + AfxEnableControlContainer(); +/* _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, + REGCLS_MULTIPLEUSE); +*/ // Standard initialization // If you are not using these features and wish to reduce the size @@ -92,3 +98,47 @@ BOOL CBrowseApp::InitInstance() // application, rather than start the application's message pump. return FALSE; } + + +CComModule _Module; + +BEGIN_OBJECT_MAP(ObjectMap) +END_OBJECT_MAP() +/* +LONG CCbrowseModule::Unlock() +{ + AfxOleUnlockApp(); + return 0; +} + +LONG CCbrowseModule::Lock() +{ + AfxOleLockApp(); + return 1; +} + +*/ +int CBrowseApp::ExitInstance() +{ +/* if (m_bATLInited) + { + _Module.RevokeClassObjects(); + _Module.Term(); + } +*/ + return CWinApp::ExitInstance(); + +} + +/* +BOOL CBrowseApp::InitATL() +{ + m_bATLInited = TRUE; + + _Module.Init(ObjectMap, AfxGetInstanceHandle()); + _Module.dwThreadID = GetCurrentThreadId(); + + return TRUE; + +} +*/ \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.dsp b/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.dsp index 54051c2c6fa..76776efe23f 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.dsp +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.dsp @@ -44,7 +44,7 @@ RSC=rc.exe # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" # ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" BSC32=bscmake.exe @@ -69,7 +69,7 @@ LINK32=link.exe # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe @@ -90,10 +90,19 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File +SOURCE=..\..\ActiveScriptSite.cpp +# End Source File +# Begin Source File + SOURCE=.\cbrowse.cpp # End Source File # Begin Source File +SOURCE=.\Cbrowse.idl +# ADD MTL /h "Cbrowse_i.h" /iid "Cbrowse_i.c" /Oicf +# End Source File +# Begin Source File + SOURCE=.\cbrowse.rc # End Source File # Begin Source File @@ -131,6 +140,10 @@ SOURCE=.\Tests.cpp # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File +SOURCE=..\..\ActiveScriptSite.h +# End Source File +# Begin Source File + SOURCE=.\cbrowse.h # End Source File # Begin Source File @@ -200,7 +213,14 @@ SOURCE=.\res\testpassed.ico # End Group # Begin Source File +SOURCE=.\Cbrowse.rgs +# End Source File +# Begin Source File + SOURCE=.\ReadMe.txt # End Source File # End Target # End Project +# Section cbrowse : {10404710-0021-001E-1B00-1B00EAA80000} +# 1:11:IDR_CBROWSE:103 +# End Section diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.h b/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.h index 2d225d39976..08d5e1fad3d 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.h +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.h @@ -13,6 +13,7 @@ #endif #include "resource.h" // main symbols +#include "Cbrowse_i.h" ///////////////////////////////////////////////////////////////////////////// // CBrowseApp: @@ -29,6 +30,7 @@ public: //{{AFX_VIRTUAL(CBrowseApp) public: virtual BOOL InitInstance(); + virtual int ExitInstance(); //}}AFX_VIRTUAL // Implementation @@ -38,6 +40,13 @@ public: // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_MSG DECLARE_MESSAGE_MAP() +private: + +/* + BOOL m_bATLInited; +private: + BOOL InitATL(); +*/ }; diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.rc b/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.rc index 15041d7f071..0d7c7951669 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.rc +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/cbrowse.rc @@ -113,7 +113,7 @@ BEGIN TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | WS_BORDER | WS_TABSTOP,271,16,100,211 GROUPBOX "Tests",IDC_STATIC,265,7,112,303 - COMBOBOX IDC_URL,45,7,117,52,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_URL,45,7,117,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "<",IDC_BACKWARD,203,7,25,13 PUSHBUTTON ">",IDC_FORWARD,234,7,25,13 @@ -189,6 +189,13 @@ BEGIN END #endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_CBROWSE REGISTRY DISCARDABLE "Cbrowse.rgs" #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/webshell/embed/ActiveX/tests/cbrowse/resource.h b/mozilla/webshell/embed/ActiveX/tests/cbrowse/resource.h index e47af6d9fc9..1b98c33b5bd 100644 --- a/mozilla/webshell/embed/ActiveX/tests/cbrowse/resource.h +++ b/mozilla/webshell/embed/ActiveX/tests/cbrowse/resource.h @@ -4,6 +4,7 @@ // #define IDS_CHOOSEBROWSER 1 #define IDD_CBROWSE_DIALOG 102 +#define IDR_CBROWSE 103 #define IDR_MAINFRAME 128 #define IDD_PICKBROWSER 129 #define IDI_CLOSEDFOLDER 130 @@ -32,6 +33,6 @@ #define _APS_NEXT_RESOURCE_VALUE 135 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1014 -#define _APS_NEXT_SYMED_VALUE 101 +#define _APS_NEXT_SYMED_VALUE 104 #endif #endif