| Index: android_webview/javatests/src/org/chromium/android_webview/test/GetTitleTest.java
|
| diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/GetTitleTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/GetTitleTest.java
|
| index c8ba6ef4f57dea4e6477569e0e5774cdc2763946..e933e06e34895e3d5dc475831c665deac11063b0 100644
|
| --- a/android_webview/javatests/src/org/chromium/android_webview/test/GetTitleTest.java
|
| +++ b/android_webview/javatests/src/org/chromium/android_webview/test/GetTitleTest.java
|
| @@ -8,7 +8,6 @@ import android.test.suitebuilder.annotation.SmallTest;
|
| import android.test.suitebuilder.annotation.Smoke;
|
|
|
| import org.chromium.android_webview.AwContents;
|
| -import org.chromium.base.test.util.DisabledTest;
|
| import org.chromium.base.test.util.Feature;
|
| import org.chromium.net.test.util.TestWebServer;
|
|
|
| @@ -149,21 +148,16 @@ public class GetTitleTest extends AwTestBase {
|
| assertEquals("Incorrect title :: " , info.mUrl, info.mTitle);
|
| }
|
|
|
| - /**
|
| - * A subtle bug started to appear after the merge to r157579. If document.writeln is
|
| - * used in the page's script then the page's title is reported incorrectly.
|
| - * Bug: crbug.com/151012
|
| - * @SmallTest
|
| - * @Feature({"AndroidWebView"})
|
| - */
|
| - @DisabledTest
|
| - public void testGetTitleWithWriteln() throws Throwable {
|
| + @SmallTest
|
| + @Feature({"AndroidWebView"})
|
| + public void testGetTitleSetFromJS() throws Throwable {
|
| final String expectedTitle = "Expected";
|
| final String page =
|
| - // Note: document.title="...";document.writeln(document.title); also fails.
|
| - "<html>" +
|
| - "<body onload='document.writeln(document.title=\"" + expectedTitle + "\")'>" +
|
| + "<html><head>" +
|
| + "<script>document.title=\"" + expectedTitle + "\"</script>" +
|
| + "</head><body>" +
|
| "</body></html>";
|
| + getAwSettingsOnUiThread(mAwContents).setJavaScriptEnabled(true);
|
| final String title = loadFromDataAndGetTitle(page);
|
| assertEquals("Incorrect title :: ", expectedTitle, title);
|
| }
|
|
|