pjs/embedding/qa/testembed
bsmedberg%covad.net 385b97b0d8 Adding MOZILLA_INTERNAL_API to internal makefiles, bug 288626, rs=darin 2005-04-04 17:32:01 +00:00
..
components Adding MOZILLA_INTERNAL_API to internal makefiles, bug 288626, rs=darin 2005-04-04 17:32:01 +00:00
res
BrowserFrameGlue.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserFrm.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserFrm.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserImpl.cpp Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
BrowserImpl.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserImplCtxMenuLstnr.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserImplHistoryLstnr.cpp Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
BrowserImplPrompt.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserImplWebPrgrsLstnr.cpp Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
BrowserToolTip.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserToolTip.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserView.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
BrowserView.cpp.mod Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-08-25 23:02:50 +00:00
BrowserView.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
Dialogs.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
Dialogs.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
DomWindow.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
DomWindow.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
IBrowserFrameGlue.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
Makefile.in Adding MOZILLA_INTERNAL_API to internal makefiles, bug 288626, rs=darin 2005-04-04 17:32:01 +00:00
MostRecentUrls.cpp http://www.mozilla.org/hacking/portable-cpp.html 2004-10-25 05:51:24 +00:00
MostRecentUrls.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
Preferences.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
Preferences.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
PrintProgressDialog.cpp Bug 178643: Remove uses of NS_INIT_ISUPPORTS, since it is no longer needed. r=timeless sr=jag 2003-01-08 20:32:55 +00:00
PrintProgressDialog.h fixed compiler bugs. removed nsIWebBrowser.cpp because of naming conflict, adding nsIWebBrow.cpp for test cases. 2002-05-21 21:37:34 +00:00
ProfileMgr.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
ProfileMgr.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
ProfilesDlg.cpp Updated to show profiles dialog at startup 2002-07-26 21:34:44 +00:00
ProfilesDlg.h
QaFindDlg.cpp Adding test cases for nsIWebBrowserFind. New url for simple text search. 2002-06-21 02:31:36 +00:00
QaFindDlg.h Adding test cases for nsIWebBrowserFind. New url for simple text search. 2002-06-21 02:31:36 +00:00
QaUtils.cpp Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
QaUtils.h Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
README.TXT Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-08-25 23:02:50 +00:00
Selection.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
Selection.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
StdAfx.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
StdAfx.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
TestEmbed.cpp eliminating uses of deprecated nsComponentManager:: methods (bug 267040), r=bsmedberg 2004-11-01 18:50:36 +00:00
TestEmbed.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
Tests.cpp fix bustage 2004-11-12 19:06:19 +00:00
Tests.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
UrlDialog.cpp Added protocol menu to UrlDialog. Hooked up nsIWebBrowserFind to screen dialog output. 2002-10-03 02:42:09 +00:00
UrlDialog.h Added protocol menu to UrlDialog. Hooked up nsIWebBrowserFind to screen dialog output. 2002-10-03 02:42:09 +00:00
WebProgDlg.cpp Added web progress notification dialog; and additional flag to url dialog. 2002-07-23 22:31:23 +00:00
WebProgDlg.h Added web progress notification dialog; and additional flag to url dialog. 2002-07-23 22:31:23 +00:00
nsICmdParams.cpp refactored code, changes to object error checking handling. not part of the build. 2002-11-28 22:39:58 +00:00
nsICmdParams.h Hooked up command data table to nsICmdParam tests. Table to be revised at later time. not part of the build. 2002-09-21 08:06:16 +00:00
nsICommandMgr.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsICommandMgr.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIEditSession.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIEditSession.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIFile.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIFile.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIObserServ.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIObserServ.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIWebBrow.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIWebBrow.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIWebBrowFind.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIWebBrowFind.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIWebNav.cpp Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
nsIWebNav.h Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
nsIWebProg.cpp Bug 226439. Convert codebase to use AppendLiteral/AssignLiteral/LowerCaseEqualsLiteral. r+sr=darin 2004-06-17 00:13:25 +00:00
nsIWebProg.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIclipboardcmd.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsIclipboardcmd.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsProfile.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsProfile.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsiDirServ.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsiDirServ.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsiHistory.cpp Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
nsiHistory.h Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
nsichanneltests.cpp 243387 - about:plugins broken by download size reduction changes. Move about:plugins page to global package to remove dependency on defunct "communicator" package. r=mconnor 2004-06-20 01:42:05 +00:00
nsichanneltests.h Added additional cases to post AsyncOpen tests for nsIChannel tests. Additional request methods used for SetRequestMethod in httpChannel tests. Some cleanup in a few functions. 2004-05-07 02:43:23 +00:00
nsihttpchanneltests.cpp Added additional cases to post AsyncOpen tests for nsIChannel tests. Additional request methods used for SetRequestMethod in httpChannel tests. Some cleanup in a few functions. 2004-05-07 02:43:23 +00:00
nsihttpchanneltests.h Added VisitRequestHeaders and VisitResponseHeaders for nsiHttpChannel tests. 2003-01-24 03:56:31 +00:00
nsirequest.cpp Added SaveObject() function in QAUtils.cpp. This is called in AsyncOpenTest() to compare the support objects passed to AsyncOpen and OnStartRequest. 2004-05-20 02:15:10 +00:00
nsirequest.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
resource.h added View Logfile & Delete Logfile from Tools menu 2004-04-15 00:28:26 +00:00
testembed.aps added View Logfile & Delete Logfile from Tools menu 2004-04-15 00:28:26 +00:00
testembed.dsp minor changes to screen dialogs, "Run All Tests" for interface tests run more smoothly. 2002-10-05 04:03:32 +00:00
testembed.dsw *** empty log message *** 2004-03-31 00:09:37 +00:00
testembed.htm
testembed.rc added View Logfile & Delete Logfile from Tools menu 2004-04-15 00:28:26 +00:00
winEmbedFileLocProvider.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
winEmbedFileLocProvider.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00

README.TXT

***** BEGIN LICENSE BLOCK *****
Version: MPL 1.1/GPL 2.0/LGPL 2.1

The contents of this file are subject to the Mozilla Public License Version 
1.1 (the "License"); you may not use this file except in compliance with 
the License. You may obtain a copy of the License at 
http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is is mozilla.org code.

The Initial Developer of the Original Code is 
Netscape Communications Corporation.
Portions created by the Initial Developer are Copyright (C) 1998
the Initial Developer. All Rights Reserved.

Contributor(s):
  Chak Nanga <chak@netscape.com>
  David Epstein <depstein@netscape.com>

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.

***** END LICENSE BLOCK *****

TestEmbed is a C++ test app based upon mfcEmbed. It includes
individual test cases for Embedding interface methods. Interfaces
covered include nsIFile & nsILocalFile, nsISHistory, nsIWebNavigation,
nsIWebProgressListener, nsIClipboardCommands, nsIRequest, nsIDOMWindow,
nsIDirectoryService, nsIProfile, nsIObserverService, nsIWebBrowser,
nsIWebProgress, nsIWebBrowserFind, nsIEditingSession, nsICommandManager,
nsICommandParams, nsIStreamListener, nsIURIContentListener,
nsISHistoryListener, nsIWebBrowserChrome, and nsIEmbeddingSiteWindow.
.
Individual tests also exist for methods found in nsIGlobalHistory
and nsIProfile.

In addition to the mfcEmbed menus, it contains 5 menus: Tests,
Interfaces, Tools, Verified Bugs, and Clipboard Commands.

Executed test cases print output to a logfile called TestOutput.txt.
This will be created in the C:\temp folder.

See build instructions below.
	
General Overview:
-----------------

1. The TestEmbedApp creates BrowserFrames

2. BrowserFrame creates the toolbar, statusbar, URLbar 
   BrowserView etc.
   BrowserFrames implement the IBrowserFrameGlue interface
   using which new BrowserFrames can be created, statusbar
   updated etc. 

3. BrowserView creates the embeddable browser instance and
   manages user interaction such as URL navigation etc.
   BrowserView connects the BrowserImpl with the BrowserFrame
   via the IBrowserFrameGlue interface

4. BrowserImpl implements the set of required/optional Gecko
   embedding interfaces
   

Start by first looking at TestEmbed.cpp

Files:

StdAfx.h	 
	- Includes the required Mozilla header files

TestEmbed.cpp 
	- CWinApp derived class
	- Creates the browser's main frame window etc
	  using the CreateNewBrowserFrame() and loads
	  the HomePage
	- Makes the required NS_InitEmbedding() and the
	  NS_TermEmbedding() calls in the app's InitInstance()
	  and ExitInstance() functions
	- Keeps track of the list of new BrowserFrames created
	  which it cleans up properly in ExitInstance()

BrowserFrm.cpp 
	- This is the browser's Frame window i.e. the one with the
	  "chrome" - with the toolbar, urlbar etc.
	- Creates the toolbar, URLbar, statusbar, progressbar 
	  also the browser's view window. 

BrowserFrameGlue.cpp
	- Implements the IBrowserFrameGlue interface. This interface
	  contains platform specific implementations of functions to
	  update the statusbar, creating new browser frames etc. Embedded
	  browser's callbacks use this interface when needed

BrowserView.cpp 
	- Creates the embedded browser object and handles most aspects
	of the embedded browser interactions - like URL navigation,
	clipboard interactions etc
	- Also has code to keep the menu/toolbar/statusbar UI items up 
	to date
	- It's the view which conntects the BrowserFrame to the BrowserImpl
	  (see below) by passing it the pointer to IBrowserFrameGlue

BrowserImpl*.cpp 
	- Implements the required and/or optional embedded browser 
	interfaces
	(BrowserImpl.cpp implements the set of interfaces which 
	are required by Gecko of all embedding apps. The other
	interfaces implemented in the BrowserImpl*.cpp files are 
	optional. Included in the BrowserImpl.cpp file are interface tests for 					nsIWebBrowserChrome,nsIEmbeddingSiteWindow, nsIStreamListener, and 				nsIURIContentListener.)

	- Calls on the statusbar/progressbar update functions exposed
	via the IBrowserFrameGlue in response to the nsIWebProgressListener
	interface callbacks. nsIWebProgressListener methods are implemented
	in BrowserImplWebPrgrsLstnr.cpp. nsISHistoryListener methods are
	implemented in BrowserImplHistoryLstnr.cpp

Dialogs.cpp
	- Contains dialog box code for displaying Prompts, getting
	passwords, getting username/passwords etc
	- Contains the CFindDialog class - used for searching text
	in a web page

winEmbedFileLocProvider.cpp, ProfilesDlg.cpp, ProfileMgr.cpp
	- Profile management related code (by Conrad Carlen)

Tests.cpp
	- This is where individual test cases are stored and test interfaces are
	registered. The file is divided into three sections: 1) individual test 
	cases corresponding to the "Tests" menu. 2) tools that are helpful,
	corresponding to the "Tools" menu. These include routines like
	removing all entries from Global History. 3) Registration of
	interface tests with CTests object (bottom part of the file). Example: 

	void CTests::OnInterfacesNsidomwindow()
	{
		CDomWindow oDomWindow(qaWebBrowser) ;
		oDomWindow.OnStartTests(nCommandID);
	}

	The interface tests OnInterfacesNsidomwindow() is associated with menu
	handlers in the message map (in top part of the file). For this example,
	ON_COMMAND(ID_INTERFACES_NSIDOMWINDOW_RUNALLTESTS, OnInterfacesNsidomwindow).
	The test interface object (oDomWindow) is created with appropriate constructor.
	Then the object calls the test interface's OnStartTests() method and passes
	the selected command ID.


QAUtils.cpp
	- This contains routines that are useful to QA. Such tasks as
	printing to a logfile, displaying messages to the screen, formatting
	output data, retrieving the name of an nsI request, and getting a urI 
	are stored here.

makefile.in
	- We define "_AFXDLL" and for the compiler and specify
	"-SUBSYSTEM:windows" for the linker using LCFLAGS and 
	LLFLAGS, respectively
	- We also define "USE_SINGLE_SIGN_ON" to enable the
	single sign-on support
	- Also need REQUIRES for all modules to be included
	- Place all .cpp files for compiling in CPPSRCS section.

testembed.dsp and testembed.dsw
	- These VisualStudio workspace/project files can be used
	to open/build this sample inside of the VC++ IDE

Most interface tests have their own .cpp & .h files (e.g. nsIWebBrow.cpp).

Instructions for building:
	1) Open a dos shell.
	2) cd /mozilla/embedding/qa/testembed	   // testEmbed directory
	3) Copy the makefile.in file and call it makefile. Place in same directory.
	4) Change the top few lines in 'makefile' to indicate local pathway. Example:
		DEPTH		= ../../..
		topsrcdir	= d:/mozilla_src/mozilla
		srcdir		= d:/mozilla_src/mozilla/embedding/qa/testembed
		VPATH		= d:/mozilla_src/mozilla/embedding/qa/testembed
	5) cd components			  // components directory
	6) Copy the makefile.in file and call it makefile. Place in same directory.
	7) Change the top few lines in 'makefile' to indicate local pathway. Example:
		DEPTH		= ../../../..
		topsrcdir    = d:/mozilla_src/mozilla
		srcdir       = d:/mozilla_src/mozilla/embedding/qa/testembed/components
		VPATH        = d:/mozilla_src/mozilla/embedding/qa/testembed/components
	8) make				   	// compile 'makefile.in' in components
	9) cd ..				// return to testembed folder
	10) make				// compile 'makefile.in' in testembed
	11) cd ../../../dist/bin/	   	// navigate to the bin dir
	12) testembed.exe			// run testEmbed.exe

	note: if 'make' doesn't work above, try 'make -f makefile.in'

A few suggestions:
	1) Don't run nsIWebNavigation tests after turning on the Web
	Progress listener (from Tests menu). This will create all types
	of listener msgs in your logfile and display many msgs on the 
	screen.
	2) Best way to use web progress listener is to turn it on (from 
	the Tests menu)then change URL . Change a few more urls and
	monitor the output.
	3) Before running nsISHistory interface tests, load 1-2 urls.
	That will create a session history. The same applies for the
	nsIWebNavigation interfaces tests. One loaded url will enable
	back/forward navigation.
	4) nsIUriContentListener is registered from the "Tests" >
	"Add urIContentListener" menu. There are submenu items for different options.