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.chrome.browser.input; | 5 package org.chromium.chrome.browser.input; |
6 | 6 |
7 import android.test.suitebuilder.annotation.LargeTest; | 7 import android.test.suitebuilder.annotation.LargeTest; |
8 | 8 |
9 import org.chromium.base.test.util.DisabledTest; | 9 import org.chromium.base.test.util.DisabledTest; |
10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Once clicked, the popup should show up. | 70 // Once clicked, the popup should show up. |
71 DOMUtils.clickNode(this, view, viewClient, "select"); | 71 DOMUtils.clickNode(this, view, viewClient, "select"); |
72 assertTrue("The select popup did not show up on click.", | 72 assertTrue("The select popup did not show up on click.", |
73 CriteriaHelper.pollForCriteria(new PopupShowingCriteria())); | 73 CriteriaHelper.pollForCriteria(new PopupShowingCriteria())); |
74 | 74 |
75 // Now create and destroy a different ContentView. | 75 // Now create and destroy a different ContentView. |
76 UiUtils.runOnUiThread(getActivity(), new Runnable() { | 76 UiUtils.runOnUiThread(getActivity(), new Runnable() { |
77 @Override | 77 @Override |
78 public void run() { | 78 public void run() { |
79 int nativeWebContents = ContentViewUtil.createNativeWebContents(
false); | 79 int nativeWebContents = ContentViewUtil.createNativeWebContents(
false); |
80 WindowAndroid nativeWindow = new WindowAndroid(getActivity()); | 80 WindowAndroid windowAndroid = new WindowAndroid(getActivity()); |
81 ContentView contentView = ContentView.newInstance( | 81 ContentView contentView = ContentView.newInstance( |
82 getActivity(), nativeWebContents, | 82 getActivity(), nativeWebContents, |
83 nativeWindow, ContentView.PERSONALITY_CHROME); | 83 windowAndroid, ContentView.PERSONALITY_CHROME); |
84 contentView.destroy(); | 84 contentView.destroy(); |
85 } | 85 } |
86 }); | 86 }); |
87 | 87 |
88 // Process some more events to give a chance to the dialog to hide if it
were to. | 88 // Process some more events to give a chance to the dialog to hide if it
were to. |
89 getInstrumentation().waitForIdleSync(); | 89 getInstrumentation().waitForIdleSync(); |
90 | 90 |
91 // The popup should still be shown. | 91 // The popup should still be shown. |
92 assertNotNull("The select popup got hidden by destroying of unrelated Co
ntentViewCore.", | 92 assertNotNull("The select popup got hidden by destroying of unrelated Co
ntentViewCore.", |
93 SelectPopupDialog.getCurrent()); | 93 SelectPopupDialog.getCurrent()); |
94 } | 94 } |
95 } | 95 } |
OLD | NEW |