M build-tests.xml
- comment in all tests M classes_spec/org/mozilla/webclient/Navigation2.java M classes_spec/org/mozilla/webclient/impl/wrapper_native/NavigationImpl.java - add loadFromStreamBlocking, until we have DocumentLoadListener working M src_moz/InputStreamShim.cpp M src_moz/InputStreamShim.h - rollback the nsIAsyncInputStream changes. M test/automated/src/classes/org/mozilla/webclient/NavigationTest.java - test from a FileInputStream M test/automated/src/classes/org/mozilla/webclient/RandomHTMLInputStream.java - Allow notification when read completes. git-svn-id: svn://10.0.0.236/trunk@157311 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: NavigationTest.java,v 1.5 2004-04-28 16:40:15 edburns%acm.org Exp $
|
||||
* $Id: NavigationTest.java,v 1.6 2004-06-02 14:31:24 edburns%acm.org Exp $
|
||||
*/
|
||||
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
@@ -35,6 +35,7 @@ import java.awt.Frame;
|
||||
import java.awt.BorderLayout;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
// NavigationTest.java
|
||||
|
||||
@@ -89,10 +90,14 @@ 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(5, false);
|
||||
nav.loadFromStream(rhis, "http://randomstream.com/",
|
||||
"text/html", -1, null);
|
||||
|
||||
// try loading from a FileInputStream
|
||||
FileInputStream fis = new FileInputStream(testPage);
|
||||
nav.loadFromStreamBlocking(fis, "http://somefile.com/",
|
||||
"text/html", -1, null);
|
||||
currentPage.selectAll();
|
||||
selection = currentPage.getSelection();
|
||||
assertTrue(-1 != selection.toString().indexOf("This test file is for the NavigationTest."));
|
||||
System.out.println("Selection is: " + selection.toString());
|
||||
|
||||
frame.setVisible(false);
|
||||
|
||||
@@ -211,6 +211,14 @@ public int read(byte[] b, int off, int len) throws IOException
|
||||
numRead = max;
|
||||
available -= max;
|
||||
}
|
||||
try {
|
||||
synchronized(this) {
|
||||
this.notify();
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IOException("RandomHTMLInputStream: Can't notify listeners");
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -254,6 +262,14 @@ public void close() throws IOException
|
||||
throw new IOException("It's time for an IOException!");
|
||||
}
|
||||
isClosed = true;
|
||||
try {
|
||||
synchronized(this) {
|
||||
this.notify();
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IOException("RandomHTMLInputStream: Can't notify listeners");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldThrowException()
|
||||
|
||||
Reference in New Issue
Block a user