assertTrue(driver.isDirty());
}
public void testDirtyWithDelegate() {
PersonEditorWithDelegate editor = new PersonEditorWithDelegate();
PersonEditorWithDelegateDriver driver = GWT.create(PersonEditorWithDelegateDriver.class);
driver.initialize(editor);
driver.edit(person);
// Freshly-initialized should not be dirty
assertFalse(driver.isDirty());
// Use the delegate to toggle the state
editor.delegate.setDirty(true);
assertTrue(driver.isDirty());
// Use the delegate to clear the state
editor.delegate.setDirty(false);
assertFalse(driver.isDirty());
// Check that the delegate has no influence over values
editor.addressEditor.city.setValue("edited");
assertTrue(driver.isDirty());
editor.delegate.setDirty(false);
assertTrue(driver.isDirty());
editor.delegate.setDirty(true);
assertTrue(driver.isDirty());
}