| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.chrome.browser.input; | 5 package org.chromium.chrome.browser.input; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.os.Build; | 10 import android.os.Build; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return mActivityWindowAndroidForTest; | 77 return mActivityWindowAndroidForTest; |
| 78 } | 78 } |
| 79 }); | 79 }); |
| 80 launchChromeShellWithUrl(DATA_URL); | 80 launchChromeShellWithUrl(DATA_URL); |
| 81 assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading()); | 81 assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading()); |
| 82 | 82 |
| 83 mContentViewCore = getActivity().getActiveContentViewCore(); | 83 mContentViewCore = getActivity().getActiveContentViewCore(); |
| 84 // TODO(aurimas) remove this wait once crbug.com/179511 is fixed. | 84 // TODO(aurimas) remove this wait once crbug.com/179511 is fixed. |
| 85 assertWaitForPageScaleFactorMatch(2); | 85 assertWaitForPageScaleFactorMatch(2); |
| 86 assertTrue( | 86 assertTrue( |
| 87 DOMUtils.waitForNonZeroNodeBounds(mContentViewCore, "input_file"
)); | 87 DOMUtils.waitForNonZeroNodeBounds(mContentViewCore.getWebContent
s(), "input_file")); |
| 88 } | 88 } |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * Tests that clicks on <input type="file" /> trigger intent calls to Activi
tyWindowAndroid. | 91 * Tests that clicks on <input type="file" /> trigger intent calls to Activi
tyWindowAndroid. |
| 92 */ | 92 */ |
| 93 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) | 93 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) |
| 94 @MediumTest | 94 @MediumTest |
| 95 @Feature({"TextInput", "Main"}) | 95 @Feature({"TextInput", "Main"}) |
| 96 public void testSelectFileAndCancelRequest() throws Throwable { | 96 public void testSelectFileAndCancelRequest() throws Throwable { |
| 97 DOMUtils.clickNode(this, mContentViewCore, "input_file"); | 97 DOMUtils.clickNode(this, mContentViewCore, "input_file"); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 @Override | 132 @Override |
| 133 public void run() { | 133 public void run() { |
| 134 mActivityWindowAndroidForTest.lastCallback.onIntentCompleted( | 134 mActivityWindowAndroidForTest.lastCallback.onIntentCompleted( |
| 135 mActivityWindowAndroidForTest, Activity.RESULT_CANCELED,
null, null); | 135 mActivityWindowAndroidForTest, Activity.RESULT_CANCELED,
null, null); |
| 136 } | 136 } |
| 137 }); | 137 }); |
| 138 mActivityWindowAndroidForTest.lastCallback = null; | 138 mActivityWindowAndroidForTest.lastCallback = null; |
| 139 mActivityWindowAndroidForTest.lastIntent = null; | 139 mActivityWindowAndroidForTest.lastIntent = null; |
| 140 } | 140 } |
| 141 } | 141 } |
| OLD | NEW |