use of org.prebid.mobile.rendering.models.internal.MraidVariableContainer in project prebid-mobile-android by prebid.
the class AdBaseDialog method handleExpandPropertiesResult.
private void handleExpandPropertiesResult(String expandProperties) {
if (mWebViewBase == null || mWebViewBase.getMRAIDInterface() == null) {
LogUtil.debug(TAG, "handleExpandPropertiesResult: WebViewBase or MraidInterface is null. Skipping.");
return;
}
final MraidVariableContainer mraidVariableContainer = mWebViewBase.getMRAIDInterface().getMraidVariableContainer();
mraidVariableContainer.setExpandProperties(expandProperties);
// Fill interstitial manager with expand properties.
mDisplayView = mWebViewBase;
mHasExpandProperties = true;
MraidContinue();
}
use of org.prebid.mobile.rendering.models.internal.MraidVariableContainer in project prebid-mobile-android by prebid.
the class BaseJSInterfaceTest method setOrientationPropertiesTest.
@Test
public void setOrientationPropertiesTest() throws IllegalAccessException {
final MraidVariableContainer mraidVariableContainer = mSpyBaseJSInterface.getMraidVariableContainer();
assertNull(mraidVariableContainer.getOrientationProperties());
String properties = "test";
mraidVariableContainer.setOrientationProperties(properties);
assertEquals(properties, mraidVariableContainer.getOrientationProperties());
}
use of org.prebid.mobile.rendering.models.internal.MraidVariableContainer in project prebid-mobile-android by prebid.
the class BaseJSInterfaceTest method setExpandPropertiesTest.
@Test
public void setExpandPropertiesTest() {
final MraidVariableContainer mraidVariableContainer = mSpyBaseJSInterface.getMraidVariableContainer();
String expandProperties = mraidVariableContainer.getExpandProperties();
assertNull(expandProperties);
mraidVariableContainer.setExpandProperties("test");
assertEquals("test", mraidVariableContainer.getExpandProperties());
}
use of org.prebid.mobile.rendering.models.internal.MraidVariableContainer in project prebid-mobile-android by prebid.
the class MraidExpandTest method expandTest.
@Test
public void expandTest() {
doAnswer(invocation -> {
RedirectUrlListener listener = invocation.getArgument(1);
listener.onSuccess("test", "html");
return null;
}).when(mSpyBaseJsInterface).followToOriginalUrl(anyString(), any(RedirectUrlListener.class));
PrebidWebViewBase mockPreloadedListener = mock(PrebidWebViewBase.class);
HTMLCreative mockCreative = mock(HTMLCreative.class);
when(mockPreloadedListener.getCreative()).thenReturn(mockCreative);
when(mMockWebViewBase.getPreloadedListener()).thenReturn(mockPreloadedListener);
CompletedCallBack callBack = mock(CompletedCallBack.class);
final MraidVariableContainer mraidVariableContainer = mSpyBaseJsInterface.getMraidVariableContainer();
mraidVariableContainer.setCurrentState(JSInterface.STATE_DEFAULT);
MraidExpand spyExpand = spy(mMraidExpand);
doAnswer(invocation -> {
CompletedCallBack completedCallBack = invocation.getArgument(1);
completedCallBack.expandDialogShown();
return null;
}).when(spyExpand).showExpandDialog(any(), any());
spyExpand.expand("test", callBack);
verify(mSpyBaseJsInterface).followToOriginalUrl(anyString(), any(RedirectUrlListener.class));
assertEquals(mraidVariableContainer.getUrlForLaunching(), "test");
verify(callBack).expandDialogShown();
verify(spyExpand).showExpandDialog(any(), any());
}
use of org.prebid.mobile.rendering.models.internal.MraidVariableContainer in project prebid-mobile-android by prebid.
the class MraidInternalBrowserAction method launchBrowserActivity.
@VisibleForTesting
void launchBrowserActivity(final Context context, BaseJSInterface jsInterface, String url) {
final MraidVariableContainer mraidVariableContainer = jsInterface.getMraidVariableContainer();
if (url != null) {
mraidVariableContainer.setUrlForLaunching(url);
}
ExternalViewerUtils.startBrowser(context, mraidVariableContainer.getUrlForLaunching(), mBroadcastId, true, null);
}
Aggregations