JNIEXPORT void JNICALL Java_org_adblockplus_android_ABPEngine_refreshSubscription(JNIEnv *pEnv, jobject, jstring url) { D(D_WARN, "refreshSubscription()"); try { const std::string surl = GetString(pEnv, url); AdblockPlus::SubscriptionPtr subscription = filterEngine->GetSubscription(surl); subscription->UpdateFilters(); } catch (const std::exception& e) { ThrowJavaException(pEnv, e); } catch (...) { ThrowJavaException(pEnv); } }
TEST_F(FilterEngineTest, SubscriptionUpdates) { AdblockPlus::SubscriptionPtr subscription = filterEngine->GetSubscription("foo"); ASSERT_FALSE(subscription->IsUpdating()); subscription->UpdateFilters(); }