Chromium Code Reviews
DescriptionRefactor BrowsingDataRemover to mock out WebappRegistry.
WebappRegistry makes JNI calls from the browsing data remover. This
interferes with C++ unit tests, as the Java side code is not initialised
in these tests. Any C++ unit test which calls through the JNI will hang
and time out.
This CL refactors the static methods in WebappRegistry into instance
methods, and adds a scoped pointer to WebappRegistry as a member on
BrowsingDataRemover. This allows the class to be mocked out at test time
to prevent the JNI call; thus browsing data remover tests which trigger
JNI calls can be run on Android. A follow-up CL will add a JNI call on
history removal to the browsing data remover; this pathway is currently
used in C++ unit tests and will hang without the mocking implemented in
this CL.
WebappRegistry only exists on Android, and there is no reason for it to
exist on a desktop build. Thus, this patch uses #if BUILDFLAG to ensure
the registry pointer and method calls are only present on Android.
BUG=570579
Committed: https://crrev.com/ce31ade9a645c56b5d5be16acffa6b8f81e8748e
Cr-Commit-Position: refs/heads/master@{#380541}
Patch Set 1 #Patch Set 2 : Rebase #
Total comments: 3
Patch Set 3 : Use PostDelayedTask #
Dependent Patchsets: Messages
Total messages: 24 (9 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||