| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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.ThreadUtils; | 9 import org.chromium.base.ThreadUtils; |
| 10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 DOMUtils.clickNode(this, viewCore, "select"); | 81 DOMUtils.clickNode(this, viewCore, "select"); |
| 82 CriteriaHelper.pollInstrumentationThread(new PopupShowingCriteria()); | 82 CriteriaHelper.pollInstrumentationThread(new PopupShowingCriteria()); |
| 83 | 83 |
| 84 // Now create and destroy a different ContentView. | 84 // Now create and destroy a different ContentView. |
| 85 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 85 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 86 @Override | 86 @Override |
| 87 public void run() { | 87 public void run() { |
| 88 WebContents webContents = WebContentsFactory.createWebContents(f
alse, false); | 88 WebContents webContents = WebContentsFactory.createWebContents(f
alse, false); |
| 89 WindowAndroid windowAndroid = new ActivityWindowAndroid(getActiv
ity()); | 89 WindowAndroid windowAndroid = new ActivityWindowAndroid(getActiv
ity()); |
| 90 | 90 |
| 91 ContentViewCore contentViewCore = new ContentViewCore(getActivit
y()); | 91 ContentViewCore contentViewCore = new ContentViewCore(getActivit
y(), ""); |
| 92 ContentView cv = ContentView.createContentView(getActivity(), co
ntentViewCore); | 92 ContentView cv = ContentView.createContentView(getActivity(), co
ntentViewCore); |
| 93 contentViewCore.initialize(ViewAndroidDelegate.createBasicDelega
te(cv), cv, | 93 contentViewCore.initialize(ViewAndroidDelegate.createBasicDelega
te(cv), cv, |
| 94 webContents, windowAndroid); | 94 webContents, windowAndroid); |
| 95 contentViewCore.destroy(); | 95 contentViewCore.destroy(); |
| 96 } | 96 } |
| 97 }); | 97 }); |
| 98 | 98 |
| 99 // Process some more events to give a chance to the dialog to hide if it
were to. | 99 // Process some more events to give a chance to the dialog to hide if it
were to. |
| 100 getInstrumentation().waitForIdleSync(); | 100 getInstrumentation().waitForIdleSync(); |
| 101 | 101 |
| 102 // The popup should still be shown. | 102 // The popup should still be shown. |
| 103 assertNotNull("The select popup got hidden by destroying of unrelated Co
ntentViewCore.", | 103 assertNotNull("The select popup got hidden by destroying of unrelated Co
ntentViewCore.", |
| 104 viewCore.getSelectPopupForTest()); | 104 viewCore.getSelectPopupForTest()); |
| 105 } | 105 } |
| 106 } | 106 } |
| OLD | NEW |