Methods Summary |
---|
public void | clearBackForwardList()
mWebView.clearHistory();
|
public void | display()
mWebView.invalidate();
|
public void | dump(boolean timeout, java.lang.String webkitData)
if (mResultFile == null || mResultFile.length() == 0) {
finished();
return;
}
try {
File parentDir = new File(mResultFile).getParentFile();
if (!parentDir.exists()) {
parentDir.mkdirs();
}
FileOutputStream os = new FileOutputStream(mResultFile);
if (timeout) {
Log.w("Layout test: Timeout", mResultFile);
os.write(TIMEOUT_STR.getBytes());
os.write('\n");
}
if (mDumpTitleChanges)
os.write(mTitleChanges.toString().getBytes());
if (mDialogStrings != null)
os.write(mDialogStrings.toString().getBytes());
mDialogStrings = null;
os.write(webkitData.getBytes());
os.flush();
os.close();
} catch (IOException ex) {
Log.e(LOGTAG, "Cannot write to " + mResultFile + ", " + ex.getMessage());
}
finished();
|
public void | dumpAsText()
mDumpAsText = true;
if (mWebView != null) {
String url = mWebView.getUrl();
Log.v(LOGTAG, "dumpAsText called: "+url);
}
|
public void | dumpBackForwardList()
//printf("\n============== Back Forward List ==============\n");
// mWebHistory
//printf("===============================================\n");
|
public void | dumpChildFrameScrollPositions()
// TODO Auto-generated method stub
|
public void | dumpEditingCallbacks()
// TODO Auto-generated method stub
|
public void | dumpSelectionRect()
// TODO Auto-generated method stub
|
public void | dumpTitleChanges()
if (!mDumpTitleChanges) {
mTitleChanges = new StringBuffer();
}
mDumpTitleChanges = true;
|
private void | executeIntent(android.content.Intent intent)
resetTestStatus();
if (!Intent.ACTION_VIEW.equals(intent.getAction())) {
return;
}
mTestUrl = intent.getStringExtra(TEST_URL);
if (mTestUrl == null)
return;
mResultFile = intent.getStringExtra(RESULT_FILE);
mTimeoutInMillis = intent.getIntExtra(TIMEOUT_IN_MILLIS, 0);
Log.v(LOGTAG, " Loading " + mTestUrl);
mWebView.loadUrl(mTestUrl);
if (mTimeoutInMillis > 0) {
// Create a timeout timer
Message m = mHandler.obtainMessage(MSG_TIMEOUT);
mHandler.sendMessageDelayed(m, mTimeoutInMillis);
}
|
public void | finished()
if (mCallback != null) {
mCallback.finished();
}
|
public void | keepWebHistory()
if (!mKeepWebHistory) {
mWebHistory = new Vector();
}
mKeepWebHistory = true;
|
public void | notifyDone()
String url = mWebView.getUrl();
Log.v(LOGTAG, "notifyDone called: " + url);
if (mWaitUntilDone) {
mWaitUntilDone = false;
mChromeClient.onProgressChanged(mWebView, 100);
}
|
protected void | onCreate(Bundle icicle)
super.onCreate(icicle);
LinearLayout contentView = new LinearLayout(this);
contentView.setOrientation(LinearLayout.VERTICAL);
setContentView(contentView);
mWebView = new WebView(this);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebChromeClient(mChromeClient);
mEventSender = new WebViewEventSender(mWebView);
mCallbackProxy = new CallbackProxy(mEventSender, this);
mWebView.addJavascriptInterface(mCallbackProxy, "layoutTestController");
mWebView.addJavascriptInterface(mCallbackProxy, "eventSender");
contentView.addView(mWebView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0.0f));
mWebView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
mHandler = new AsyncHandler();
Intent intent = getIntent();
if (intent != null) {
executeIntent(intent);
}
|
protected void | onDestroy()
super.onDestroy();
mWebView.destroy();
mWebView = null;
|
public void | onLowMemory()
super.onLowMemory();
Log.e(LOGTAG, "Low memory, kill self");
System.exit(1);
|
protected void | onNewIntent(android.content.Intent intent)
super.onNewIntent(intent);
executeIntent(intent);
|
protected void | onStop()
super.onStop();
mWebView.stopLoading();
|
public void | queueBackNavigation(int howfar)
// TODO Auto-generated method stub
|
public void | queueForwardNavigation(int howfar)
// TODO Auto-generated method stub
|
public void | queueLoad(java.lang.String Url, java.lang.String frameTarget)
// TODO Auto-generated method stub
|
public void | queueReload()
mWebView.reload();
|
public void | queueScript(java.lang.String scriptToRunInCurrentContext)
mWebView.loadUrl("javascript:"+scriptToRunInCurrentContext);
|
public void | repaintSweepHorizontally()
// TODO Auto-generated method stub
|
public void | requestWebKitData()
Message callback = mHandler.obtainMessage(MSG_WEBKIT_DATA);
if (mRequestedWebKitData)
throw new AssertionError("Requested webkit data twice: " + mWebView.getUrl());
mRequestedWebKitData = true;
if (mDumpAsText) {
mWebView.documentAsText(callback);
} else {
mWebView.externalRepresentation(callback);
}
|
private void | resetTestStatus()
mWaitUntilDone = false;
mDumpAsText = false;
mTimedOut = false;
mDumpTitleChanges = false;
mRequestedWebKitData = false;
mEventSender.resetMouse();
|
public void | setAcceptsEditing(boolean b)
// TODO Auto-generated method stub
|
public void | setCallback(TestShellCallback callback)
mCallback = callback;
|
public void | setMainFrameIsFirstResponder(boolean b)
// TODO Auto-generated method stub
|
public void | setWindowIsKey(boolean b)
// This is meant to show/hide the window. The best I can find
// is setEnabled()
mWebView.setEnabled(b);
|
public void | testRepaint()
mWebView.invalidate();
|
public void | waitUntilDone()
mWaitUntilDone = true;
String url = mWebView.getUrl();
Log.v(LOGTAG, "waitUntilDone called: " + url);
|