summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorShimeng (Simon) Wang <swang@google.com>2010-06-21 10:07:35 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-06-21 10:07:35 -0700
commitfedffeedb433677652cf6e1dc7b73f369f05e447 (patch)
tree6ca54d0d09173db8f1597e8e87c27964825c6339 /core
parent9e2b41ca20d634fd7c400102322ff67e96c9f0ab (diff)
parentad45686d727c8c9a602ba0534d3b052fdaf6c8d6 (diff)
downloadframeworks_base-fedffeedb433677652cf6e1dc7b73f369f05e447.zip
frameworks_base-fedffeedb433677652cf6e1dc7b73f369f05e447.tar.gz
frameworks_base-fedffeedb433677652cf6e1dc7b73f369f05e447.tar.bz2
Merge "Add dumpChildFramesAsText function support in LayoutTestController."
Diffstat (limited to 'core')
-rw-r--r--core/java/android/webkit/BrowserFrame.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index 7bdefd0..7b1aab2 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -517,12 +517,21 @@ class BrowserFrame extends Handler {
private native String externalRepresentation();
/**
- * Retrieves the visual text of the current frame, puts it as the object for
+ * Retrieves the visual text of the frames, puts it as the object for
* the message and sends the message.
* @param callback the message to use to send the visual text
*/
public void documentAsText(Message callback) {
- callback.obj = documentAsText();;
+ StringBuilder text = new StringBuilder();
+ if (callback.arg1 != 0) {
+ // Dump top frame as text.
+ text.append(documentAsText());
+ }
+ if (callback.arg2 != 0) {
+ // Dump child frames as text.
+ text.append(childFramesAsText());
+ }
+ callback.obj = text.toString();
callback.sendToTarget();
}
@@ -531,6 +540,11 @@ class BrowserFrame extends Handler {
*/
private native String documentAsText();
+ /**
+ * Return the text drawn on the child frames as a string
+ */
+ private native String childFramesAsText();
+
/*
* This method is called by WebCore to inform the frame that
* the Javascript window object has been cleared.