Search in sources :

Example 1 with TestDomObject

use of com.taobao.weex.dom.TestDomObject in project weex-example by KalicyZhou.

the class WXAnimationModuleTest method testStartAnimation.

@Test
public void testStartAnimation() throws Exception {
    module.startAnimation(module.mWXSDKInstance, null, null, null);
    TestComponent comp = new TestComponent(module.mWXSDKInstance, new TestDomObject(), null);
    module.startAnimation(module.mWXSDKInstance, comp, null, null);
    WXAnimationBean animation = new WXAnimationBean();
    module.startAnimation(module.mWXSDKInstance, comp, animation, null);
    animation.styles = new WXAnimationBean.Style();
    module.startAnimation(module.mWXSDKInstance, comp, animation, null);
}
Also used : TestComponent(com.taobao.weex.ui.component.TestComponent) TestDomObject(com.taobao.weex.dom.TestDomObject) WXSDKInstanceTest(com.taobao.weex.WXSDKInstanceTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 2 with TestDomObject

use of com.taobao.weex.dom.TestDomObject in project weex-example by KalicyZhou.

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

Example 3 with TestDomObject

use of com.taobao.weex.dom.TestDomObject in project weex-example by KalicyZhou.

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 4 with TestDomObject

use of com.taobao.weex.dom.TestDomObject in project weex-example by KalicyZhou.

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 5 with TestDomObject

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

the class DefaultDragHelperTest method onDragEnd.

@Test
public void onDragEnd() throws Exception {
    WXComponent c = new WXCell(WXSDKInstanceTest.createInstance(), new TestDomObject(), null, false);
    mFakeDragHelper.onDragEnd(c, 1, 2);
    verify(mockedEventTrigger).triggerEvent(eq("dragend"), 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)

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