| OLD | NEW |
| 1 // Copyright (c) 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.test.suitebuilder.annotation.SmallTest; | 7 import android.test.suitebuilder.annotation.SmallTest; |
| 8 import android.test.suitebuilder.annotation.Smoke; | 8 import android.test.suitebuilder.annotation.Smoke; |
| 9 | 9 |
| 10 import org.chromium.android_webview.AwContents; | 10 import org.chromium.android_webview.AwContents; |
| 11 import org.chromium.base.test.util.Feature; | 11 import org.chromium.base.test.util.Feature; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 26 private AwContents mAwContents; | 26 private AwContents mAwContents; |
| 27 | 27 |
| 28 private static class PageInfo { | 28 private static class PageInfo { |
| 29 public final String mTitle; | 29 public final String mTitle; |
| 30 public final String mUrl; | 30 public final String mUrl; |
| 31 | 31 |
| 32 public PageInfo(String title, String url) { | 32 public PageInfo(String title, String url) { |
| 33 mTitle = title; | 33 mTitle = title; |
| 34 mUrl = url; | 34 mUrl = url; |
| 35 } | 35 } |
| 36 }; | 36 } |
| 37 | 37 |
| 38 @Override | 38 @Override |
| 39 public void setUp() throws Exception { | 39 public void setUp() throws Exception { |
| 40 super.setUp(); | 40 super.setUp(); |
| 41 mContentsClient = new TestAwContentsClient(); | 41 mContentsClient = new TestAwContentsClient(); |
| 42 final AwTestContainerView testContainerView = | 42 final AwTestContainerView testContainerView = |
| 43 createAwTestContainerViewOnMainSync(mContentsClient); | 43 createAwTestContainerViewOnMainSync(mContentsClient); |
| 44 mAwContents = testContainerView.getAwContents(); | 44 mAwContents = testContainerView.getAwContents(); |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 final String expectedTitle = "Expected"; | 161 final String expectedTitle = "Expected"; |
| 162 final String page = | 162 final String page = |
| 163 // Note: document.title="...";document.writeln(document.title);
also fails. | 163 // Note: document.title="...";document.writeln(document.title);
also fails. |
| 164 "<html>" + | 164 "<html>" + |
| 165 "<body onload='document.writeln(document.title=\"" + expectedTit
le + "\")'>" + | 165 "<body onload='document.writeln(document.title=\"" + expectedTit
le + "\")'>" + |
| 166 "</body></html>"; | 166 "</body></html>"; |
| 167 final String title = loadFromDataAndGetTitle(page); | 167 final String title = loadFromDataAndGetTitle(page); |
| 168 assertEquals("Incorrect title :: ", expectedTitle, title); | 168 assertEquals("Incorrect title :: ", expectedTitle, title); |
| 169 } | 169 } |
| 170 } | 170 } |
| OLD | NEW |