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

Unified Diff: components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java

Issue 1635033002: Revert of Add API for custom library loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/cronet/android/java/src/org/chromium/net/CronetLibraryLoader.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
index 195eafcb1a7abfc2279b281e5744cb784d27c68e..ce07d6bdca5eb22145ced74721f3991f8d7bd926 100644
--- a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
+++ b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
@@ -960,35 +960,4 @@
// Verifies that CronetEngine.Builder config from testCronetEngineBuilderConfig() is properly
// translated to a native UrlRequestContextConfig.
private static native void nativeVerifyUrlRequestContextConfig(long config, String storagePath);
-
- private static class TestBadLibraryLoader extends CronetEngine.Builder.LibraryLoader {
- private boolean mWasCalled = false;
-
- public void loadLibrary(String libName) {
- // Report that this method was called, but don't load the library
- mWasCalled = true;
- }
-
- boolean wasCalled() {
- return mWasCalled;
- }
- }
-
- @SmallTest
- @Feature({"Cronet"})
- public void testSkipLibraryLoading() throws Exception {
- CronetEngine.Builder builder = new CronetEngine.Builder(getContext());
- TestBadLibraryLoader loader = new TestBadLibraryLoader();
- builder.setLibraryLoader(loader).setLibraryName("cronet_tests");
- try {
- // ensureInitialized() calls native code to check the version right after library load
- // and will error with the message below if library loading was skipped
- CronetLibraryLoader.ensureInitialized(getContext(), builder);
- fail("Native library should not be loaded");
- } catch (UnsatisfiedLinkError e) {
- assertTrue(e.getMessage().contains(
- "No implementation found for java.lang.String org.chromium.net"));
- assertTrue(loader.wasCalled());
- }
- }
}
« no previous file with comments | « components/cronet/android/java/src/org/chromium/net/CronetLibraryLoader.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698