public void testDispatchEventAtRoot() {
NativeEvent eventAtRoot = createMockNativeEvent(uiRoot, "click");
UiRendererUi.getRenderer().onBrowserEvent(fooReceiver, eventAtRoot, uiRoot, new Foo("one"), "two");
assertEquals(1, fooReceiver.handlerCalled);
assertEquals("click", fooReceiver.event.getAssociatedType().getName());
assertEquals(uiRoot, fooReceiver.root);
assertEquals("one", fooReceiver.firstExtraParam.bar);
assertEquals("two", fooReceiver.secondExtraParam);
// Dispatch also works when the parent is passed
fooReceiver = new MockFooReceiver();
UiRendererUi.getRenderer().onBrowserEvent(fooReceiver, eventAtRoot, uiParent, new Foo("three"), "four");
assertEquals(1, fooReceiver.handlerCalled);
assertEquals("click", fooReceiver.event.getAssociatedType().getName());
assertEquals(uiRoot, fooReceiver.root);
assertEquals("three", fooReceiver.firstExtraParam.bar);