Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1946)

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java

Issue 11571008: [Android] Add API for specifying a charset for data Urls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix joth's comments. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java
index ea41e8060f7888d52dcaa40bcdca589f73251d42..8e959645181add84f152e56bb5549ff61c336a68 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java
@@ -55,6 +55,23 @@ public class AndroidWebViewLoadUrlTest extends AndroidWebViewTestBase {
assertEquals(expectedTitle, getTitleOnUiThread(awContents));
}
+ @SmallTest
+ @Feature({"AndroidWebView"})
+ public void testDataUrlCharset() throws Throwable {
+ // Note that the '£' is the important character in the following
+ // string as it's not in the US_ASCII character set.
+ final String expectedTitle = "You win £100!";
+ final String data =
+ "<html><head><title>" + expectedTitle + "</title></head><body>foo</body></html>";
+ final TestAwContentsClient contentsClient = new TestAwContentsClient();
+ final AwTestContainerView testContainerView =
+ createAwTestContainerViewOnMainSync(contentsClient);
+ final AwContents awContents = testContainerView.getAwContents();
+ loadDataSyncWithCharset(awContents, contentsClient.getOnPageFinishedHelper(), data,
+ "text/html", false, "UTF-8");
+ assertEquals(expectedTitle, getTitleOnUiThread(awContents));
+ }
+
/**
* Loads url on the UI thread and blocks until onPageFinished is called.
*/
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698