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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/input/SelectFileDialogTest.java

Issue 572013002: Removing ContentViewCore dependencies from direct WebContents functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the patch and addressed review comments. Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698