Chromium Code Reviews| 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.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.Point; | 8 import android.graphics.Point; |
| 9 import android.os.Build; | 9 import android.os.Build; |
| 10 import android.os.SystemClock; | 10 import android.os.SystemClock; |
| (...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1590 @Feature({"AndroidWebView", "Preferences"}) | 1590 @Feature({"AndroidWebView", "Preferences"}) |
| 1591 public void testDatabaseInitialValue() throws Throwable { | 1591 public void testDatabaseInitialValue() throws Throwable { |
| 1592 TestAwContentsClient client = new TestAwContentsClient(); | 1592 TestAwContentsClient client = new TestAwContentsClient(); |
| 1593 final AwTestContainerView testContainerView = | 1593 final AwTestContainerView testContainerView = |
| 1594 createAwTestContainerViewOnMainSync(client); | 1594 createAwTestContainerViewOnMainSync(client); |
| 1595 final AwContents awContents = testContainerView.getAwContents(); | 1595 final AwContents awContents = testContainerView.getAwContents(); |
| 1596 AwSettingsDatabaseTestHelper helper = new AwSettingsDatabaseTestHelper(a wContents, client); | 1596 AwSettingsDatabaseTestHelper helper = new AwSettingsDatabaseTestHelper(a wContents, client); |
| 1597 helper.ensureSettingHasInitialValue(); | 1597 helper.ensureSettingHasInitialValue(); |
| 1598 } | 1598 } |
| 1599 | 1599 |
| 1600 @SmallTest | 1600 /** |
| 1601 @Feature({"AndroidWebView", "Preferences"}) | 1601 * @SmallTest |
| 1602 * @Feature({"AndroidWebView", "Preferences"}) | |
| 1603 * crbug.com/261409 | |
| 1604 */ | |
| 1605 @DisabledTest | |
| 1602 public void testDatabaseEnabled() throws Throwable { | 1606 public void testDatabaseEnabled() throws Throwable { |
|
boliu
2013/07/18 00:19:55
Hmm, this is a different crash
boliu
2013/07/18 00:21:31
04018: 07-17 22:54:15.937 9917 9951 W WebKit :
| |
| 1603 TestAwContentsClient client = new TestAwContentsClient(); | 1607 TestAwContentsClient client = new TestAwContentsClient(); |
| 1604 final AwTestContainerView testContainerView = | 1608 final AwTestContainerView testContainerView = |
| 1605 createAwTestContainerViewOnMainSync(client); | 1609 createAwTestContainerViewOnMainSync(client); |
| 1606 final AwContents awContents = testContainerView.getAwContents(); | 1610 final AwContents awContents = testContainerView.getAwContents(); |
| 1607 AwSettingsDatabaseTestHelper helper = new AwSettingsDatabaseTestHelper(a wContents, client); | 1611 AwSettingsDatabaseTestHelper helper = new AwSettingsDatabaseTestHelper(a wContents, client); |
| 1608 helper.setAlteredSettingValue(); | 1612 helper.setAlteredSettingValue(); |
| 1609 helper.ensureSettingHasAlteredValue(); | 1613 helper.ensureSettingHasAlteredValue(); |
| 1610 } | 1614 } |
| 1611 | 1615 |
| 1612 @SmallTest | 1616 @SmallTest |
| 1613 @Feature({"AndroidWebView", "Preferences"}) | 1617 @Feature({"AndroidWebView", "Preferences"}) |
| 1614 public void testDatabaseDisabled() throws Throwable { | 1618 public void testDatabaseDisabled() throws Throwable { |
| 1615 TestAwContentsClient client = new TestAwContentsClient(); | 1619 TestAwContentsClient client = new TestAwContentsClient(); |
| 1616 final AwTestContainerView testContainerView = | 1620 final AwTestContainerView testContainerView = |
| 1617 createAwTestContainerViewOnMainSync(client); | 1621 createAwTestContainerViewOnMainSync(client); |
| 1618 final AwContents awContents = testContainerView.getAwContents(); | 1622 final AwContents awContents = testContainerView.getAwContents(); |
| 1619 AwSettingsDatabaseTestHelper helper = new AwSettingsDatabaseTestHelper(a wContents, client); | 1623 AwSettingsDatabaseTestHelper helper = new AwSettingsDatabaseTestHelper(a wContents, client); |
| 1620 helper.setInitialSettingValue(); | 1624 helper.setInitialSettingValue(); |
| 1621 helper.ensureSettingHasInitialValue(); | 1625 helper.ensureSettingHasInitialValue(); |
| 1622 } | 1626 } |
| 1623 | 1627 |
| 1624 @SmallTest | 1628 /** |
| 1625 @Feature({"AndroidWebView", "Preferences"}) | 1629 * @SmallTest |
| 1630 * @Feature({"AndroidWebView", "Preferences"}) | |
| 1631 * crbug.com/261409 | |
| 1632 */ | |
| 1633 @DisabledTest | |
| 1626 public void testUniversalAccessFromFilesWithTwoViews() throws Throwable { | 1634 public void testUniversalAccessFromFilesWithTwoViews() throws Throwable { |
| 1627 ViewPair views = createViews(); | 1635 ViewPair views = createViews(); |
| 1628 runPerViewSettingsTest( | 1636 runPerViewSettingsTest( |
| 1629 new AwSettingsUniversalAccessFromFilesTestHelper(views.getContents0( ), | 1637 new AwSettingsUniversalAccessFromFilesTestHelper(views.getContents0( ), |
| 1630 views.getClient0()), | 1638 views.getClient0()), |
| 1631 new AwSettingsUniversalAccessFromFilesTestHelper(views.getContents1( ), | 1639 new AwSettingsUniversalAccessFromFilesTestHelper(views.getContents1( ), |
| 1632 views.getClient1())); | 1640 views.getClient1())); |
| 1633 } | 1641 } |
| 1634 | 1642 |
| 1635 // This test verifies that local image resources can be loaded from file: | 1643 // This test verifies that local image resources can be loaded from file: |
| 1636 // URLs regardless of file access state. | 1644 // URLs regardless of file access state. |
| 1637 @SmallTest | 1645 @SmallTest |
| 1638 @Feature({"AndroidWebView", "Preferences"}) | 1646 @Feature({"AndroidWebView", "Preferences"}) |
| 1639 public void testFileAccessFromFilesImage() throws Throwable { | 1647 public void testFileAccessFromFilesImage() throws Throwable { |
| 1640 final String imageContainerUrl = UrlUtils.getTestFileUrl("webview/image_ access.html"); | 1648 final String imageContainerUrl = UrlUtils.getTestFileUrl("webview/image_ access.html"); |
| 1641 final String imageHeight = "16"; | 1649 final String imageHeight = "16"; |
| 1642 final TestAwContentsClient contentClient = new TestAwContentsClient(); | 1650 final TestAwContentsClient contentClient = new TestAwContentsClient(); |
| 1643 final AwTestContainerView testContainerView = | 1651 final AwTestContainerView testContainerView = |
| 1644 createAwTestContainerViewOnMainSync(contentClient); | 1652 createAwTestContainerViewOnMainSync(contentClient); |
| 1645 final AwContents awContents = testContainerView.getAwContents(); | 1653 final AwContents awContents = testContainerView.getAwContents(); |
| 1646 AwSettings settings = getAwSettingsOnUiThread(awContents); | 1654 AwSettings settings = getAwSettingsOnUiThread(awContents); |
| 1647 settings.setJavaScriptEnabled(true); | 1655 settings.setJavaScriptEnabled(true); |
| 1648 settings.setAllowUniversalAccessFromFileURLs(false); | 1656 settings.setAllowUniversalAccessFromFileURLs(false); |
| 1649 settings.setAllowFileAccessFromFileURLs(false); | 1657 settings.setAllowFileAccessFromFileURLs(false); |
| 1650 loadUrlSync(awContents, contentClient.getOnPageFinishedHelper(), imageCo ntainerUrl); | 1658 loadUrlSync(awContents, contentClient.getOnPageFinishedHelper(), imageCo ntainerUrl); |
| 1651 assertEquals(imageHeight, getTitleOnUiThread(awContents)); | 1659 assertEquals(imageHeight, getTitleOnUiThread(awContents)); |
| 1652 } | 1660 } |
| 1653 | 1661 |
| 1654 @SmallTest | 1662 /** |
| 1655 @Feature({"AndroidWebView", "Preferences"}) | 1663 * @SmallTest |
| 1664 * @Feature({"AndroidWebView", "Preferences"}) | |
| 1665 * crbug.com/261409 | |
| 1666 */ | |
| 1667 @DisabledTest | |
| 1656 public void testFileAccessFromFilesIframeWithTwoViews() throws Throwable { | 1668 public void testFileAccessFromFilesIframeWithTwoViews() throws Throwable { |
| 1657 ViewPair views = createViews(); | 1669 ViewPair views = createViews(); |
| 1658 runPerViewSettingsTest( | 1670 runPerViewSettingsTest( |
| 1659 new AwSettingsFileAccessFromFilesIframeTestHelper( | 1671 new AwSettingsFileAccessFromFilesIframeTestHelper( |
| 1660 views.getContents0(), views.getClient0()), | 1672 views.getContents0(), views.getClient0()), |
| 1661 new AwSettingsFileAccessFromFilesIframeTestHelper( | 1673 new AwSettingsFileAccessFromFilesIframeTestHelper( |
| 1662 views.getContents1(), views.getClient1())); | 1674 views.getContents1(), views.getClient1())); |
| 1663 } | 1675 } |
| 1664 | 1676 |
| 1665 @SmallTest | 1677 @SmallTest |
| (...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2650 awContents.onTouchEvent(MotionEvent.obtain( | 2662 awContents.onTouchEvent(MotionEvent.obtain( |
| 2651 secondTapTime, secondTapTime, MotionEvent.ACTION_DOWN, | 2663 secondTapTime, secondTapTime, MotionEvent.ACTION_DOWN, |
| 2652 x, y, 0)); | 2664 x, y, 0)); |
| 2653 awContents.onTouchEvent(MotionEvent.obtain( | 2665 awContents.onTouchEvent(MotionEvent.obtain( |
| 2654 secondTapTime, secondTapTime, MotionEvent.ACTION_UP, | 2666 secondTapTime, secondTapTime, MotionEvent.ACTION_UP, |
| 2655 x, y, 0)); | 2667 x, y, 0)); |
| 2656 } | 2668 } |
| 2657 }); | 2669 }); |
| 2658 } | 2670 } |
| 2659 } | 2671 } |
| OLD | NEW |