use of com.taobao.weex.dom.TestDomObject in project incubator-weex by apache.
the class ComponentTest method create.
public static void create(WXComponent comp, View view) {
TestDomObject domObject = new TestDomObject();
WXVContainer parent;
if ((parent = comp.getParent()) != null) {
if (view != null) {
comp.mHost = view;
} else {
comp.createView();
}
} else {
parent = WXDivTest.create();
parent.addChild(comp);
parent.createChildViewAt(-1);
}
comp.setLayout(domObject);
domObject = new TestDomObject();
comp.updateDom(domObject);
comp.applyLayoutAndEvent(comp);
addEvent(comp);
}
use of com.taobao.weex.dom.TestDomObject in project incubator-weex by apache.
the class WXImageTest method setUp.
@Before
public void setUp() throws Exception {
mInstance = WXSDKInstanceTest.createInstance();
mDomObject = new TestDomObject();
PowerMockito.when(Mockito.spy(mDomObject).clone()).thenReturn(mDomObject);
mWXDiv = PowerMockito.mock(WXDiv.class);
mWXImage = new WXImage(mInstance, mDomObject, mWXDiv);
}
use of com.taobao.weex.dom.TestDomObject in project weex-example by KalicyZhou.
the class WXImageTest method setUp.
@Before
public void setUp() throws Exception {
mInstance = WXSDKInstanceTest.createInstance();
mDomObject = new TestDomObject();
PowerMockito.when(Mockito.spy(mDomObject).clone()).thenReturn(mDomObject);
mWXDiv = PowerMockito.mock(WXDiv.class);
mWXImage = new WXImage(mInstance, mDomObject, mWXDiv);
}
use of com.taobao.weex.dom.TestDomObject in project weex-example by KalicyZhou.
the class WXSliderTest method testPages.
@Test
public void testPages() throws Exception {
component = create();
component.addChild(ComponentTest.createComponent(new TestDomObject(), component, TestComponent.class));
component.addChild(ComponentTest.createComponent(new TestDomObject(), component, TestComponent.class));
component.addChild(ComponentTest.createComponent(new TestDomObject(), component, TestComponent.class));
component.addChild(ComponentTest.createComponent(new TestDomObject(), component, TestComponent.class));
component.addChild(ComponentTest.createComponent(new TestDomObject(), component, TestComponent.class));
WXIndicator indicator = new WXIndicator(component.getInstance(), new TestDomObject(), component, false);
ComponentTest.create(indicator);
component.addChild(indicator);
ComponentTest.create(component);
assertEquals(5, component.mViewPager.getCirclePageAdapter().getRealCount());
assertEquals(6, component.getChildCount());
component.mViewPager.setCurrentItem(0);
}
use of com.taobao.weex.dom.TestDomObject in project incubator-weex by apache.
the class DefaultDragHelperTest method setUp.
@Before
public void setUp() throws Exception {
WXDiv div = WXDivTest.create();
ComponentTest.create(div);
listComponent = create(div);
ComponentTest.create(listComponent);
fakeCell = new WXCell(WXSDKInstanceTest.createInstance(), new TestDomObject(), null, false);
c1 = new WXCell(WXSDKInstanceTest.createInstance(), new TestDomObject(), null, false);
c2 = new WXCell(WXSDKInstanceTest.createInstance(), new TestDomObject(), null, false);
c3 = new WXCell(WXSDKInstanceTest.createInstance(), new TestDomObject(), null, false);
mFakeDataSource = new ArrayList<>();
mFakeDataSource.add(c1);
mFakeDataSource.add(c2);
mFakeDataSource.add(c3);
mockedEventTrigger = mock(EventTrigger.class);
mFakeDragHelper = new DefaultDragHelper(mFakeDataSource, listComponent.getHostView().getInnerView(), mockedEventTrigger);
}
Aggregations