Search in sources :

Example 11 with TestDomObject

use of com.taobao.weex.dom.TestDomObject in project incubator-weex by apache.

the class DefaultDragHelperTest method onDragStart.

@Test
public void onDragStart() throws Exception {
    WXComponent c = new WXCell(WXSDKInstanceTest.createInstance(), new TestDomObject(), null, false);
    mFakeDragHelper.onDragStart(c, 3);
    verify(mockedEventTrigger).triggerEvent(eq("dragstart"), anyMap());
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) TestDomObject(com.taobao.weex.dom.TestDomObject) WXSDKInstanceTest(com.taobao.weex.WXSDKInstanceTest) WXDivTest(com.taobao.weex.ui.component.WXDivTest) Test(org.junit.Test) ComponentTest(com.taobao.weex.ui.component.ComponentTest)

Example 12 with TestDomObject

use of com.taobao.weex.dom.TestDomObject in project incubator-weex by apache.

the class WXSliderNeighborTest 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);
}
Also used : TestDomObject(com.taobao.weex.dom.TestDomObject) Test(org.junit.Test) WXSDKInstanceTest(com.taobao.weex.WXSDKInstanceTest)

Example 13 with TestDomObject

use of com.taobao.weex.dom.TestDomObject in project incubator-weex by apache.

the class WXSliderNeighborTest method testZoomTransformer.

@Test
public void testZoomTransformer() throws Exception {
    component = create();
    TestComponent page = ComponentTest.createComponent(new TestDomObject(), component, TestComponent.class);
    TestComponent pageChild = ComponentTest.createComponent(new TestDomObject(), component, TestComponent.class);
    page.addChild(pageChild);
    component.addChild(page);
    ComponentTest.create(component);
    // ComponentTest.create(pageChild);
    // ComponentTest.create(page);
    WXSliderNeighbor.ZoomTransformer transformer = component.createTransformer();
    transformer.transformPage(page.getHostView(), 0.2f);
}
Also used : TestDomObject(com.taobao.weex.dom.TestDomObject) Test(org.junit.Test) WXSDKInstanceTest(com.taobao.weex.WXSDKInstanceTest)

Example 14 with TestDomObject

use of com.taobao.weex.dom.TestDomObject in project incubator-weex by apache.

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);
}
Also used : TestDomObject(com.taobao.weex.dom.TestDomObject) Test(org.junit.Test) WXSDKInstanceTest(com.taobao.weex.WXSDKInstanceTest)

Aggregations

TestDomObject (com.taobao.weex.dom.TestDomObject)14 WXSDKInstanceTest (com.taobao.weex.WXSDKInstanceTest)9 Test (org.junit.Test)9 Before (org.junit.Before)3 ComponentTest (com.taobao.weex.ui.component.ComponentTest)2 WXComponent (com.taobao.weex.ui.component.WXComponent)2 WXDivTest (com.taobao.weex.ui.component.WXDivTest)2 TestComponent (com.taobao.weex.ui.component.TestComponent)1 WXDiv (com.taobao.weex.ui.component.WXDiv)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1