OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.android_webview.test; | 5 package org.chromium.android_webview.test; |
6 | 6 |
7 import android.graphics.Bitmap; | 7 import android.graphics.Bitmap; |
8 import android.graphics.BitmapFactory; | 8 import android.graphics.BitmapFactory; |
9 import android.graphics.Canvas; | 9 import android.graphics.Canvas; |
10 import android.os.Build; | 10 import android.os.Build; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // The documentation for WebView#destroy() reads "This method should be
called | 109 // The documentation for WebView#destroy() reads "This method should be
called |
110 // after this WebView has been removed from the view system. No other me
thods | 110 // after this WebView has been removed from the view system. No other me
thods |
111 // may be called on this WebView after destroy". | 111 // may be called on this WebView after destroy". |
112 // However, some apps do not respect that restriction so we need to ensu
re that | 112 // However, some apps do not respect that restriction so we need to ensu
re that |
113 // we fail gracefully and do not crash when APIs are invoked after destr
uction. | 113 // we fail gracefully and do not crash when APIs are invoked after destr
uction. |
114 // Due to the large number of APIs we only test a representative selecti
on here. | 114 // Due to the large number of APIs we only test a representative selecti
on here. |
115 awContents.clearHistory(); | 115 awContents.clearHistory(); |
116 awContents.loadUrl(new LoadUrlParams("http://www.google.com")); | 116 awContents.loadUrl(new LoadUrlParams("http://www.google.com")); |
117 awContents.findAllAsync("search"); | 117 awContents.findAllAsync("search"); |
118 assertNull(awContents.getUrl()); | 118 assertNull(awContents.getUrl()); |
119 assertNull(awContents.getContentSettings()); | |
120 assertFalse(awContents.canGoBack()); | 119 assertFalse(awContents.canGoBack()); |
121 awContents.disableJavascriptInterfacesInspection(); | 120 awContents.disableJavascriptInterfacesInspection(); |
122 awContents.invokeZoomPicker(); | 121 awContents.invokeZoomPicker(); |
123 awContents.onResume(); | 122 awContents.onResume(); |
124 awContents.stopLoading(); | 123 awContents.stopLoading(); |
125 awContents.onWindowVisibilityChanged(View.VISIBLE); | 124 awContents.onWindowVisibilityChanged(View.VISIBLE); |
126 awContents.requestFocus(); | 125 awContents.requestFocus(); |
127 awContents.isMultiTouchZoomSupported(); | 126 awContents.isMultiTouchZoomSupported(); |
128 awContents.setOverScrollMode(View.OVER_SCROLL_NEVER); | 127 awContents.setOverScrollMode(View.OVER_SCROLL_NEVER); |
129 awContents.pauseTimers(); | 128 awContents.pauseTimers(); |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageU
rl); | 558 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageU
rl); |
560 assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCo
unt()); | 559 assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCo
unt()); |
561 | 560 |
562 // Now load the same page again. This time, we still expect onReceivedSs
lError, | 561 // Now load the same page again. This time, we still expect onReceivedSs
lError, |
563 // because we only remember user's decision if it is "allow". | 562 // because we only remember user's decision if it is "allow". |
564 onSslErrorCallCount = onReceivedSslErrorHelper.getCallCount(); | 563 onSslErrorCallCount = onReceivedSslErrorHelper.getCallCount(); |
565 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageU
rl); | 564 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageU
rl); |
566 assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCo
unt()); | 565 assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCo
unt()); |
567 } | 566 } |
568 } | 567 } |
OLD | NEW |