This source file includes following definitions.
- Feature
- testJavaScriptEvalIsCorrectlyOrdered
package org.chromium.content.browser;
import android.test.suitebuilder.annotation.LargeTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content_shell_apk.ContentShellTestBase;
public class TestsJavaScriptEvalTest extends ContentShellTestBase {
private static final String JSTEST_URL = UrlUtils.encodeHtmlDataUri(
"<html><head><script>" +
" function foobar() { return 'foobar'; }" +
"</script></head>" +
"<body><button id=\"test\">Test button</button></body></html>");
public TestsJavaScriptEvalTest() {
}
@LargeTest
@Feature({"Browser"})
public void testJavaScriptEvalIsCorrectlyOrdered()
throws InterruptedException, Exception, Throwable {
launchContentShellWithUrl(JSTEST_URL);
assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading());
final ContentView view = getActivity().getActiveContentView();
final TestCallbackHelperContainer viewClient =
new TestCallbackHelperContainer(view);
for (int i = 0; i < 30; ++i) {
for (int j = 0; j < 10; ++j) {
view.evaluateJavaScript("foobar();");
}
assertNotNull("Failed to get bounds",
DOMUtils.getNodeBounds(view, viewClient, "test"));
}
}
}