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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java

Issue 2708243004: Auto convert content shell tests to JUnit4 (Closed)
Patch Set: New test added from WebContentsTest Created 3 years, 9 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 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.content.browser; 5 package org.chromium.content.browser;
6 6
7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
8 8
9 import android.support.test.filters.SmallTest; 9 import android.support.test.filters.SmallTest;
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 assertEquals("I'm here", mTestController.waitForStringValue()); 174 assertEquals("I'm here", mTestController.waitForStringValue());
175 synchronousPageReload(); 175 synchronousPageReload();
176 assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof te stObject")); 176 assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof te stObject"));
177 } 177 }
178 178
179 @SmallTest 179 @SmallTest
180 @Feature({"AndroidWebView", "Android-JavaBridge"}) 180 @Feature({"AndroidWebView", "Android-JavaBridge"})
181 public void testRemoveObjectNotAdded() throws Throwable { 181 public void testRemoveObjectNotAdded() throws Throwable {
182 TestCallbackHelperContainer.OnPageFinishedHelper onPageFinishedHelper = 182 TestCallbackHelperContainer.OnPageFinishedHelper onPageFinishedHelper =
183 getTestCallBackHelperContainer().getOnPageFinishedHelper(); 183 getTestCallBackHelperContainer().getOnPageFinishedHelper();
184
boliu 2017/03/10 18:32:32 remove this empty line change
the real yoland 2017/03/10 19:31:58 Done
184 int currentCallCount = onPageFinishedHelper.getCallCount(); 185 int currentCallCount = onPageFinishedHelper.getCallCount();
185 runTestOnUiThread(new Runnable() { 186 runTestOnUiThread(new Runnable() {
186 @Override 187 @Override
187 public void run() { 188 public void run() {
188 getContentViewCore().removeJavascriptInterface("foo"); 189 getContentViewCore().removeJavascriptInterface("foo");
189 getContentViewCore().getWebContents().getNavigationController(). reload(true); 190 getContentViewCore().getWebContents().getNavigationController(). reload(true);
190 } 191 }
191 }); 192 });
192 onPageFinishedHelper.waitForCallback(currentCallCount); 193 onPageFinishedHelper.waitForCallback(currentCallCount);
193 assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof fo o")); 194 assertEquals("undefined", executeJavaScriptAndGetStringResult("typeof fo o"));
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 executeJavaScript("testObject1.method()"); 986 executeJavaScript("testObject1.method()");
986 assertEquals(1, mTestController.waitForIntValue()); 987 assertEquals(1, mTestController.waitForIntValue());
987 executeJavaScript("testObject2.method()"); 988 executeJavaScript("testObject2.method()");
988 assertEquals(2, mTestController.waitForIntValue()); 989 assertEquals(2, mTestController.waitForIntValue());
989 executeJavaScript("testObject1.method.call(testObject2)"); 990 executeJavaScript("testObject1.method.call(testObject2)");
990 assertEquals(2, mTestController.waitForIntValue()); 991 assertEquals(2, mTestController.waitForIntValue());
991 executeJavaScript("testObject2.method.call(testObject1)"); 992 executeJavaScript("testObject2.method.call(testObject1)");
992 assertEquals(1, mTestController.waitForIntValue()); 993 assertEquals(1, mTestController.waitForIntValue());
993 } 994 }
994 } 995 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698