mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Stress test, for 64332.
This commit is contained in:
parent
24e6ca57c8
commit
a576c8c184
@ -57,7 +57,7 @@ import java.io.FileInputStream;
|
||||
* This is a test application for using the BrowserControl.
|
||||
|
||||
*
|
||||
* @version $Id: EMWindow.java,v 1.29 2001/05/08 21:57:53 edburns%acm.org Exp $
|
||||
* @version $Id: EMWindow.java,v 1.30 2001/05/23 22:26:51 edburns%acm.org Exp $
|
||||
*
|
||||
* @see org.mozilla.webclient.BrowserControlFactory
|
||||
|
||||
@ -310,7 +310,6 @@ private UniversalDialog uniDialog = null;
|
||||
"network.cookie.warnAboutCookies",
|
||||
"This IS the Closure!");
|
||||
prefs.setPref("network.cookie.warnAboutCookies", "true");
|
||||
prefs.setPref("browser.cache.disk_cache_size", "0");
|
||||
|
||||
// pull out the proxies, and make java aware of them
|
||||
Properties prefsProps = prefs.getPrefs();
|
||||
@ -418,6 +417,11 @@ public void delete()
|
||||
currentDocument = null;
|
||||
}
|
||||
|
||||
public BrowserControl getBrowserControl()
|
||||
{
|
||||
return browserControl;
|
||||
}
|
||||
|
||||
|
||||
public void actionPerformed (ActionEvent evt)
|
||||
{
|
||||
|
@ -38,69 +38,17 @@ import org.mozilla.util.Assert;
|
||||
* This is a test application for using the BrowserControl.
|
||||
|
||||
*
|
||||
* @version $Id: EmbeddedMozilla.java,v 1.5 2001/04/02 21:13:48 ashuk%eng.sun.com Exp $
|
||||
* @version $Id: EmbeddedMozilla.java,v 1.6 2001/05/23 22:26:52 edburns%acm.org Exp $
|
||||
*
|
||||
* @see org.mozilla.webclient.BrowserControlFactory
|
||||
|
||||
*/
|
||||
|
||||
public class EmbeddedMozilla
|
||||
public interface EmbeddedMozilla
|
||||
{
|
||||
|
||||
public static String binDir;
|
||||
public static String url;
|
||||
public static int count = 0;
|
||||
public EMWindow[] EMWindow_Arr;
|
||||
|
||||
public static void printUsage()
|
||||
{
|
||||
System.out.println("usage: java org.mozilla.webclient.test.EmbeddedMozilla <path> [url]");
|
||||
System.out.println(" <path> is the absolute path to the native browser bin directory, ");
|
||||
System.out.println(" including the bin.");
|
||||
}
|
||||
|
||||
public EmbeddedMozilla()
|
||||
{
|
||||
CreateEMWindow();
|
||||
}
|
||||
|
||||
public void CreateEMWindow()
|
||||
{
|
||||
System.out.println("Creating new EmbeddedMozilla window");
|
||||
EMWindow aEMWindow ;
|
||||
aEMWindow = new EMWindow("EmbeddedMozila#" + (int)(count+1),
|
||||
binDir, url, count, this);
|
||||
count++;
|
||||
}
|
||||
|
||||
public void DestroyEMWindow(int winNumber) {
|
||||
count--;
|
||||
if (count == 0) {
|
||||
System.out.println("closing application");
|
||||
try {
|
||||
BrowserControlFactory.appTerminate();
|
||||
}
|
||||
catch(Exception e) {
|
||||
System.out.println("got Exception on exit: " + e.getMessage());
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String [] arg)
|
||||
{
|
||||
if (1 > arg.length) {
|
||||
printUsage();
|
||||
System.exit(-1);
|
||||
}
|
||||
String urlArg =(2 == arg.length) ? arg[1] : "http://www.mozilla.org/projects/blackwood/webclient/";
|
||||
|
||||
// set class vars used in EmbeddedMozilla ctor
|
||||
binDir = arg[0];
|
||||
url = urlArg;
|
||||
|
||||
EmbeddedMozilla em = new EmbeddedMozilla();
|
||||
}
|
||||
public void CreateEMWindow();
|
||||
public void DestroyEMWindow(int winNumber);
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,107 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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 RaptorCanvas.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Kirk Baker and
|
||||
* Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are
|
||||
* Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Kirk Baker <kbaker@eb.com>
|
||||
* Ian Wilkinson <iw@ennoble.com>
|
||||
* Mark Goddard
|
||||
* Ed Burns <edburns@acm.org>
|
||||
*/
|
||||
|
||||
package org.mozilla.webclient.test;
|
||||
|
||||
/*
|
||||
* EmbeddedMozillaImpl.java
|
||||
*/
|
||||
|
||||
import org.mozilla.webclient.*;
|
||||
import org.mozilla.util.Assert;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
* This is a test application for using the BrowserControl.
|
||||
|
||||
*
|
||||
* @version $Id: EmbeddedMozillaImpl.java,v 1.1 2001/05/23 22:26:53 edburns%acm.org Exp $
|
||||
*
|
||||
* @see org.mozilla.webclient.BrowserControlFactory
|
||||
|
||||
*/
|
||||
|
||||
public class EmbeddedMozillaImpl implements EmbeddedMozilla
|
||||
{
|
||||
|
||||
public static String binDir;
|
||||
public static String url;
|
||||
public static int count = 0;
|
||||
public EMWindow[] EMWindow_Arr;
|
||||
|
||||
public static void printUsage()
|
||||
{
|
||||
System.out.println("usage: java org.mozilla.webclient.test.EmbeddedMozillaImpl <path> [url]");
|
||||
System.out.println(" <path> is the absolute path to the native browser bin directory, ");
|
||||
System.out.println(" including the bin.");
|
||||
}
|
||||
|
||||
public EmbeddedMozillaImpl()
|
||||
{
|
||||
CreateEMWindow();
|
||||
}
|
||||
|
||||
public void CreateEMWindow()
|
||||
{
|
||||
System.out.println("Creating new EmbeddedMozillaImpl window");
|
||||
EMWindow aEMWindow ;
|
||||
aEMWindow = new EMWindow("EmbeddedMozila#" + (int)(count+1),
|
||||
binDir, url, count, this);
|
||||
count++;
|
||||
}
|
||||
|
||||
public void DestroyEMWindow(int winNumber) {
|
||||
count--;
|
||||
if (count == 0) {
|
||||
System.out.println("closing application");
|
||||
try {
|
||||
BrowserControlFactory.appTerminate();
|
||||
}
|
||||
catch(Exception e) {
|
||||
System.out.println("got Exception on exit: " + e.getMessage());
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String [] arg)
|
||||
{
|
||||
if (1 > arg.length) {
|
||||
printUsage();
|
||||
System.exit(-1);
|
||||
}
|
||||
String urlArg =(2 == arg.length) ? arg[1] : "http://www.mozilla.org/projects/blackwood/webclient/";
|
||||
|
||||
// set class vars used in EmbeddedMozillaImpl ctor
|
||||
binDir = arg[0];
|
||||
url = urlArg;
|
||||
|
||||
EmbeddedMozillaImpl em = new EmbeddedMozillaImpl();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// EOF
|
@ -162,7 +162,7 @@ endif
|
||||
@echo ln -s -f "$$"MOZILLA_FIVE_HOME/javadev/lib/libjavadom.so "$$"MOZILLA_FIVE_HOME/components/libjavadom.so >> runem_unix_commercial
|
||||
@echo setenv CLASSPATH "$$"MOZILLA_FIVE_HOME/javadev/lib/$(LIBRARY_NAME)_$(PACKAGE_VER).jar>> runem_unix_commercial
|
||||
@echo setenv LD_LIBRARY_PATH "$$"MOZILLA_FIVE_HOME'"':'"'"$$"MOZILLA_FIVE_HOME/components'"':'"'"$$"MOZILLA_FIVE_HOME/javadev/lib'"':'"'"$$"LD_LIBRARY_PATH>> runem_unix_commercial
|
||||
@echo "$$"JDKHOME/bin/java org.mozilla.webclient.test.EmbeddedMozilla "$$"MOZILLA_FIVE_HOME "$$"1 >> runem_unix_commercial
|
||||
@echo "$$"JDKHOME/bin/java org.mozilla.webclient.test.EmbeddedMozillaImpl "$$"MOZILLA_FIVE_HOME "$$"1 >> runem_unix_commercial
|
||||
mkdir -p $(PACKAGE_EXAMPLE)
|
||||
chmod 775 $(PACKAGE_EXAMPLE)
|
||||
cp -f $(DIST)/bin/lib$(LIBRARY_NAME).so $(PACKAGE_LIB)
|
||||
@ -187,7 +187,7 @@ ifeq ($(PACKAGE_BUILD),)
|
||||
@echo +++ Creating runem. Use this to run the test browser.
|
||||
rm -f runem
|
||||
@echo #!/bin/sh > runem
|
||||
@echo $(PERL) ../src_share/runem.pl org.mozilla.webclient.test.EmbeddedMozilla $(DEPTH) "$$"1 "$$"2 "$$"3 "$$"4 "$$"4 "$$"6 >> runem
|
||||
@echo $(PERL) ../src_share/runem.pl org.mozilla.webclient.test.EmbeddedMozillaImpl $(DEPTH) "$$"1 "$$"2 "$$"3 "$$"4 "$$"4 "$$"6 >> runem
|
||||
chmod 755 runem
|
||||
else
|
||||
@echo +++ Commercial Packaging - Copying runem_solaris. Used to run test
|
||||
|
@ -138,7 +138,7 @@ buildRunems:
|
||||
!else
|
||||
@echo +++ Creating runem.bat. Use this to run the test browser.
|
||||
rm -f runem.bat
|
||||
@echo $(PERL) ..\src_share\runem.pl org.mozilla.webclient.test.EmbeddedMozilla $(DEPTH) %1% >> runem.bat
|
||||
@echo $(PERL) ..\src_share\runem.pl org.mozilla.webclient.test.EmbeddedMozillaImpl $(DEPTH) %1% >> runem.bat
|
||||
!endif
|
||||
|
||||
install:: $(DLL) buildRunems
|
||||
|
@ -43,6 +43,16 @@ images:
|
||||
@mkdir -p $(HTML_ROOT_DIR)/images
|
||||
@cp -f $(SRC)/images/*.gif $(HTML_ROOT_DIR)/images
|
||||
|
||||
stress:
|
||||
@echo compiling stress tests
|
||||
$(JDKHOME)/bin/javac -g -d $(MOZ_SRC)/mozilla/dist/classes -classpath $(MOZ_SRC)/mozilla/dist/classes ../src/classes/manual/stress/*.java
|
||||
@echo +++ Creating stress.bat. Use this to run the stress browser.
|
||||
rm -f stress
|
||||
@echo set XPCOM_CHECK_THREADSAFE=0 >> stress
|
||||
@echo perl $(MOZ_SRC)/mozilla/java/webclient/src_share/runem.pl WCRandom $(MOZ_SRC)/mozilla %1% >> stress
|
||||
chmod 755 stress
|
||||
|
||||
|
||||
cgi:
|
||||
@echo Proceed CGI scripts ...
|
||||
@perl $(UTILS)/configurator.pl $(CONFIG)/CommonProperties $(CGI_BIN_ROOT_DIR)/results.cgi $(SRC)/cgi/results.cgi
|
||||
|
@ -54,6 +54,15 @@ images:
|
||||
@mkdir $(HTML_ROOT_DIR)\images
|
||||
@copy $(SRC)\images\*.gif $(HTML_ROOT_DIR)\images
|
||||
|
||||
stress:
|
||||
@echo compiling stress tests
|
||||
$(JDKHOME)\bin\javac -g -d $(MOZ_SRC)\mozilla\dist\classes -classpath $(MOZ_SRC)\mozilla\dist\classes ..\src\classes\manual\stress\*.java
|
||||
@echo +++ Creating stress.bat. Use this to run the stress browser.
|
||||
rm -f stress.bat
|
||||
@echo set XPCOM_CHECK_THREADSAFE=0 >> stress.bat
|
||||
@echo perl $(MOZ_SRC)\mozilla\java\webclient\src_share\runem.pl WCRandom $(MOZ_SRC)\mozilla %1% >> stress.bat
|
||||
|
||||
|
||||
cgi:
|
||||
@echo Proceed CGI scripts ...
|
||||
@perl $(UTILS)\configurator.pl $(CONFIG)/CommonProperties $(CGI_BIN_ROOT_DIR)/results.cgi $(SRC)/cgi/results.cgi
|
||||
|
@ -0,0 +1,132 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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 RaptorCanvas.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Kirk Baker and
|
||||
* Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are
|
||||
* Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Kirk Baker <kbaker@eb.com>
|
||||
* Ian Wilkinson <iw@ennoble.com>
|
||||
* Mark Goddard
|
||||
* Ed Burns <edburns@acm.org>
|
||||
*/
|
||||
|
||||
import org.mozilla.webclient.*;
|
||||
import org.mozilla.webclient.test.EMWindow;
|
||||
import org.mozilla.webclient.test.EmbeddedMozilla;
|
||||
import org.mozilla.util.Assert;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
* This is a test application for using the BrowserControl.
|
||||
|
||||
*
|
||||
* @version $Id: WCRandom.java,v 1.1 2001/05/23 22:27:01 edburns%acm.org Exp $
|
||||
*
|
||||
* @see org.mozilla.webclient.BrowserControlFactory
|
||||
|
||||
*/
|
||||
|
||||
public class WCRandom implements Runnable, EmbeddedMozilla
|
||||
{
|
||||
|
||||
public static String binDir;
|
||||
public static String url;
|
||||
public static int count = 0;
|
||||
public EMWindow[] EMWindow_Arr;
|
||||
|
||||
private Navigation navigation;
|
||||
|
||||
public static void printUsage()
|
||||
{
|
||||
System.out.println("usage: java org.mozilla.webclient.test.WCRandom <path> [url]");
|
||||
System.out.println(" <path> is the absolute path to the native browser bin directory, ");
|
||||
System.out.println(" including the bin.");
|
||||
}
|
||||
|
||||
public WCRandom()
|
||||
{
|
||||
CreateEMWindow();
|
||||
}
|
||||
|
||||
public void CreateEMWindow()
|
||||
{
|
||||
System.out.println("Creating new WCRandom window");
|
||||
EMWindow aEMWindow ;
|
||||
aEMWindow = new EMWindow("EmbeddedMozila#" + (int)(count+1),
|
||||
binDir, url, count, this);
|
||||
BrowserControl b = aEMWindow.getBrowserControl();
|
||||
try {
|
||||
navigation = (Navigation) b.queryInterface(BrowserControl.NAVIGATION_NAME);
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println("Can't get Navigation from BrowserControl");
|
||||
}
|
||||
Thread t = new Thread(this, "WCRandom#" + (int)(count+1));
|
||||
t.start();
|
||||
count++;
|
||||
}
|
||||
|
||||
public void DestroyEMWindow(int winNumber) {
|
||||
count--;
|
||||
if (count == 0) {
|
||||
System.out.println("closing application");
|
||||
try {
|
||||
BrowserControlFactory.appTerminate();
|
||||
}
|
||||
catch(Exception e) {
|
||||
System.out.println("got Exception on exit: " + e.getMessage());
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String [] arg)
|
||||
{
|
||||
if (1 > arg.length) {
|
||||
printUsage();
|
||||
System.exit(-1);
|
||||
}
|
||||
String urlArg =(2 == arg.length) ? arg[1] : "http://random.yahoo.com/bin/ryl";
|
||||
|
||||
// set class vars used in WCRandom ctor
|
||||
binDir = arg[0];
|
||||
url = urlArg;
|
||||
|
||||
WCRandom em = new WCRandom();
|
||||
}
|
||||
|
||||
//
|
||||
// Methods from Runnable
|
||||
//
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (;;) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
}
|
||||
catch (Exception e) {
|
||||
}
|
||||
navigation.stop();
|
||||
navigation.loadURL(url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// EOF
|
Loading…
Reference in New Issue
Block a user