pjs/embedding/qa/testembed
seawood%netscape.com d8927fcc61 Rename 'install' build phase to 'libs'.
Bug #56601 r=pavlov
2001-11-21 09:49:41 +00:00
..
components Rename 'install' build phase to 'libs'. 2001-11-21 09:49:41 +00:00
res Adding files to qa embedding project. Not part of the build. 2001-06-20 18:28:48 +00:00
BrowserFrameGlue.cpp Bug 100476: Convert uses of member functions ToNewUnicode, ToNewCString and ToNewUTF8String to their global versions and remove support from nsCString and nsString. r=dbaron, rs=scc 2001-09-29 08:28:41 +00:00
BrowserFrm.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
BrowserFrm.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
BrowserImpl.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
BrowserImpl.h Added REQUIRES in makefiles. 2001-10-02 23:40:40 +00:00
BrowserImplCtxMenuLstnr.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
BrowserImplHistoryLstnr.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
BrowserImplPrompt.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
BrowserImplWebPrgrsLstnr.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
BrowserView.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
BrowserView.cpp.mod Bug 88413: Remove |GetUnicode()| from nsString (and replace it with |get()|). r=dbaron, rs=scc. 2001-06-30 11:02:25 +00:00
BrowserView.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
Dialogs.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
Dialogs.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
DomWindow.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
DomWindow.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
IBrowserFrameGlue.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
MostRecentUrls.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
MostRecentUrls.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
Preferences.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
Preferences.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
PrintProgressDialog.cpp Adding files to qa embedding project. Not part of the build. 2001-06-20 18:28:48 +00:00
PrintProgressDialog.h Adding files to qa embedding project. Not part of the build. 2001-06-20 18:28:48 +00:00
ProfileMgr.cpp latest testembed update 2001-09-24 19:40:00 +00:00
ProfileMgr.h Adding files to qa embedding project. Not part of the build. 2001-06-20 18:28:48 +00:00
ProfilesDlg.cpp latest testembed update 2001-09-24 19:40:00 +00:00
ProfilesDlg.h Adding files to qa embedding project. Not part of the build. 2001-06-20 18:28:48 +00:00
QaUtils.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
QaUtils.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
README.TXT updated README.TXT with description and build instructions. 2001-06-28 01:47:19 +00:00
Selection.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
Selection.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
StdAfx.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
StdAfx.h Included SimpleEnumerator.h, added maxLength check for sHistory index, updated Observe() in TestEmbed.cpp to handle profile switching changes. 2001-10-25 18:32:34 +00:00
TestEmbed.cpp per bugzilla 106523, set PR_TRUE in observerService->AddObserver() for initializing profiles 2001-10-29 19:43:32 +00:00
TestEmbed.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
Tests.cpp Bugzilla Bug 110080 change !NS_SUCCEEDED(status) to NS_FAILED(status) 2001-11-19 06:45:00 +00:00
Tests.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
UrlDialog.cpp Adding files to qa embedding project. Not part of the build. 2001-06-20 18:28:48 +00:00
UrlDialog.h Adding files to qa embedding project. Not part of the build. 2001-06-20 18:28:48 +00:00
makefile.win Rename 'install' build phase to 'libs'. 2001-11-21 09:49:41 +00:00
nsIWebNav.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
nsIWebNav.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
nsProfile.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
nsProfile.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
nsiDirServ.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
nsiDirServ.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
nsiHistory.cpp Included SimpleEnumerator.h, added maxLength check for sHistory index, updated Observe() in TestEmbed.cpp to handle profile switching changes. 2001-10-25 18:32:34 +00:00
nsiHistory.h Added REQUIRES in makefiles. 2001-10-02 23:40:40 +00:00
nsirequest.cpp License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
nsirequest.h License changes, take 2. Bug 98089. mozilla/embedding/. 2001-09-25 22:58:40 +00:00
resource.h Uploading new object model (work done by Ashish) & .cpp files for separate interface tests. 2001-09-22 00:49:38 +00:00
testembed.aps Uploading new object model (work done by Ashish) & .cpp files for separate interface tests. 2001-09-22 00:49:38 +00:00
testembed.dsp latest testembed update 2001-09-24 19:40:00 +00:00
testembed.dsw Uploading new object model (work done by Ashish) & .cpp files for separate interface tests. 2001-09-22 00:49:38 +00:00
testembed.htm Adding files to qa embedding project. Not part of the build. 2001-06-20 18:28:48 +00:00
testembed.rc Uploading new object model (work done by Ashish) & .cpp files for separate interface tests. 2001-09-22 00:49:38 +00:00
winEmbedFileLocProvider.cpp latest testembed update 2001-09-24 19:40:00 +00:00
winEmbedFileLocProvider.h Oops. 2001-09-20 00:02:59 +00:00

README.TXT

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * The contents of this file are subject to the Netscape 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/NPL/
 *
 * 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 mozilla.org code.
 *
 * The Initial Developer of the Original Code is Netscape
 * Communications Corporation.  Portions created by Netscape are
 * Copyright (C) 1998 Netscape Communications Corporation. All
 * Rights Reserved.
 *
 * Contributor(s): 
 *   Chak Nanga <chak@netscape.com>
 *   David Epstein <depstein@netscape.com>
 */

TestEmbed is a C++ test app based upon mfcEmbed. It includes
individual test cases for Embedding interface methods. Interfaces
include nsIFile & nsILocalFile, nsISHistory, nsIWebNavigation,
nsIWebProgressListener, nsIClipboardCommands, and nsIRequest.
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 file 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)

	- Calls on the statusbar/progressbar update functions exposed
	via the IBrowserFrameGlue in response to the nsIProgressListener
	interface callbacks

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. 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) Interfaces. These
	correspond to the "Interfaces" menu and contain modular tests
	for embedding interface methods.

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, and retrieving the name of an nsI request are stored
	here.

makefile.win
	- 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

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

Instructions for building:
	1) Open a dos shell.
	2) cd ../mozilla/embedding/qa/testembed	   // testEmbed directory
	3) nmake -f makefile.win		   // compile testEmbed
	4) cd ../../../dist/WIN32_D.OBJ/bin/	   // navigate to the bin dir
	5) testembed.exe			   // run testEmbed.exe

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, then
	change URL (from the Tests menu). 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) nsIRequest tests are in progress. They are implemented in
	BrowserImplWebPrgrsLstnr.cpp. A menu item was created under
	"Interfaces". This basically does the setup for nsIRequest
	tests: turns on web progress listener, and prompts user for
	a url.