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

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

Issue 117993005: [android_webview] Fix GetTitleTest.testGetTitleWithWriteln (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 6 years, 11 months 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 | no next file » | 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/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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698