This change-bundle is the start of loadFromStream(). Currently, I'm
only able to load the first burst from the RandomHTMLInputStream, because for some reason the native stream is getting closed prematurely. Need to investigate more. M classes_spec/org/mozilla/webclient/impl/wrapper_native/NavigationImpl.java - remove loadFromStreamBlocking. No point in implementing this since the loadFromStream() impl is inherently multi-threaded. M src_moz/EmbedWindow.cpp M src_moz/EmbedWindow.h - expose LoadStream() method that wraps same on nsIDocShell. M src_moz/InputStreamShim.cpp - Do a lock around our buffer deletion in or dtor. M src_moz/Makefile.in - activate nsActions and NavigationActionEvents M src_moz/NavigationActionEvents.cpp M src_moz/NavigationActionEvents.h - comment out everything but wsLoadFromStreamEvent. - fix it to work with the NativeBrowserControl. M src_moz/NavigationImpl.cpp - activate nativeLoadFromStream. This is the first *new* version method to use the old native event queue. M src_moz/ns_util.cpp M src_moz/ns_util.h - remove unused first arg from Post*Event methods. M test/automated/src/classes/org/mozilla/webclient/NavigationTest.java - activate loadFromStream test. M test/automated/src/classes/org/mozilla/webclient/RandomHTMLInputStream.java - add a randomExceptions param to the ctor to enable or disable randomly thrown exceptions. git-svn-id: svn://10.0.0.236/trunk@155640 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: NavigationTest.java,v 1.4 2004-04-28 14:39:54 edburns%acm.org Exp $
|
||||
* $Id: NavigationTest.java,v 1.5 2004-04-28 16:40:15 edburns%acm.org Exp $
|
||||
*/
|
||||
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
@@ -89,11 +89,12 @@ public class NavigationTest extends WebclientTestCase {
|
||||
assertTrue(-1 != selection.toString().indexOf("This test file is for the NavigationTest."));
|
||||
System.out.println("Selection is: " + selection.toString());
|
||||
|
||||
/*********
|
||||
RandomHTMLInputStream rhis = new RandomHTMLInputStream(3);
|
||||
RandomHTMLInputStream rhis = new RandomHTMLInputStream(5, false);
|
||||
nav.loadFromStream(rhis, "http://randomstream.com/",
|
||||
"text/html", -1, null);
|
||||
************/
|
||||
selection = currentPage.getSelection();
|
||||
System.out.println("Selection is: " + selection.toString());
|
||||
|
||||
frame.setVisible(false);
|
||||
BrowserControlFactory.deleteBrowserControl(firstBrowserControl);
|
||||
BrowserControlFactory.appTerminate();
|
||||
|
||||
@@ -75,6 +75,8 @@ private boolean isClosed;
|
||||
|
||||
private boolean firstRead;
|
||||
|
||||
private boolean randomExceptions = true;
|
||||
|
||||
/**
|
||||
|
||||
* the number of times that read(bytearray) can be called and still get
|
||||
@@ -97,9 +99,10 @@ static {
|
||||
CHARSET = charSet.getBytes();
|
||||
}
|
||||
|
||||
public RandomHTMLInputStream(int yourNumReads)
|
||||
public RandomHTMLInputStream(int yourNumReads, boolean yourRandomExceptions)
|
||||
{
|
||||
ParameterCheck.greaterThan(yourNumReads, 1);
|
||||
randomExceptions = yourRandomExceptions;
|
||||
|
||||
random = new Random();
|
||||
Assert.assert_it(null != random);
|
||||
@@ -255,6 +258,9 @@ public void close() throws IOException
|
||||
|
||||
private boolean shouldThrowException()
|
||||
{
|
||||
if (!randomExceptions) {
|
||||
return false;
|
||||
}
|
||||
int nextInt = random.nextInt(10000);
|
||||
|
||||
boolean result = false;
|
||||
|
||||
Reference in New Issue
Block a user