| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 | 8 |
| 9 import org.apache.http.Header; | 9 import org.apache.http.Header; |
| 10 import org.apache.http.HttpRequest; | 10 import org.apache.http.HttpRequest; |
| 11 | 11 |
| 12 import org.chromium.android_webview.AwContents; | 12 import org.chromium.android_webview.AwContents; |
| 13 import org.chromium.base.test.util.Feature; | 13 import org.chromium.base.test.util.Feature; |
| 14 import org.chromium.content.browser.LoadUrlParams; | 14 import org.chromium.content.browser.LoadUrlParams; |
| 15 import org.chromium.content.browser.test.util.CallbackHelper; | 15 import org.chromium.content.browser.test.util.CallbackHelper; |
| 16 import org.chromium.net.test.util.TestWebServer; | 16 import org.chromium.net.test.util.TestWebServer; |
| 17 | 17 |
| 18 import java.util.concurrent.TimeUnit; | 18 import java.util.concurrent.TimeUnit; |
| 19 import java.util.HashMap; | 19 import java.util.HashMap; |
| 20 import java.util.Map; | 20 import java.util.Map; |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * Test suite for loadUrl(). | 23 * Test suite for loadUrl(). |
| 24 */ | 24 */ |
| 25 public class AndroidWebViewLoadUrlTest extends AndroidWebViewTestBase { | 25 public class LoadUrlTest extends AwTestBase { |
| 26 @SmallTest | 26 @SmallTest |
| 27 @Feature({"AndroidWebView"}) | 27 @Feature({"AndroidWebView"}) |
| 28 public void testDataUrl() throws Throwable { | 28 public void testDataUrl() throws Throwable { |
| 29 final String expectedTitle = "dataUrlTest"; | 29 final String expectedTitle = "dataUrlTest"; |
| 30 final String data = | 30 final String data = |
| 31 "<html><head><title>" + expectedTitle + "</title></head><body>foo</b
ody></html>"; | 31 "<html><head><title>" + expectedTitle + "</title></head><body>foo</b
ody></html>"; |
| 32 | 32 |
| 33 final TestAwContentsClient contentsClient = new TestAwContentsClient(); | 33 final TestAwContentsClient contentsClient = new TestAwContentsClient(); |
| 34 final AwTestContainerView testContainerView = | 34 final AwTestContainerView testContainerView = |
| 35 createAwTestContainerViewOnMainSync(contentsClient); | 35 createAwTestContainerViewOnMainSync(contentsClient); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 Header header = matchingHeaders[0]; | 126 Header header = matchingHeaders[0]; |
| 127 assertEquals(headerNames[i].toLowerCase(), header.getName()); | 127 assertEquals(headerNames[i].toLowerCase(), header.getName()); |
| 128 assertEquals(headerValues[i], header.getValue()); | 128 assertEquals(headerValues[i], header.getValue()); |
| 129 } | 129 } |
| 130 } finally { | 130 } finally { |
| 131 if (webServer != null) webServer.shutdown(); | 131 if (webServer != null) webServer.shutdown(); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 } | 134 } |
| OLD | NEW |