Skip to content

Commit

Permalink
8245457: TestBug] Enable and fix ignored tests in ButtonBaseTest & Bu…
Browse files Browse the repository at this point in the history
…ttonTest

Reviewed-by: kcr, arapte
  • Loading branch information
aghaisas committed May 22, 2020
1 parent 6e0b45a commit 1971c70
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -43,7 +43,6 @@

import org.junit.Before;
import org.junit.Test;
import org.junit.Ignore;

/**
*/
Expand Down Expand Up @@ -107,9 +106,9 @@ public class ButtonBaseTest {
assertFalse(btn.isArmed());
}

@Ignore("impl_cssSet API removed")
@Test public void cannotSpecifyArmedViaCSS() {
// btn.impl_cssSet("-fx-armed", true);
btn.setStyle("-fx-armed: true;");
btn.applyCss();
assertFalse(btn.isArmed());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -53,7 +53,6 @@
import javafx.scene.control.Skin;
import org.junit.Before;
import org.junit.After;
import org.junit.Ignore;
import org.junit.Test;
import static test.com.sun.javafx.scene.control.infrastructure.ControlTestUtils.assertPseudoClassDoesNotExist;
import static test.com.sun.javafx.scene.control.infrastructure.ControlTestUtils.assertPseudoClassExists;
Expand Down Expand Up @@ -204,10 +203,21 @@ private void show() {
assertPseudoClassDoesNotExist(btn, "default");
}

@Ignore("impl_cssSet API removed")
@Test public void cannotSpecifyDefaultButtonViaCSS() {
// btn.impl_cssSet("-fx-default-button", true);
// By default, 'btn' is not a default button
// Making it a default button via CSS should not succeed
btn.setStyle("-fx-default-button: true;");
btn.applyCss();
assertFalse(btn.isDefaultButton());

// Set button to be a default button
btn.setDefaultButton(true);
assertTrue(btn.isDefaultButton());

// Making it a non-default button via CSS should not succeed
btn.setStyle("-fx-default-button: false;");
btn.applyCss();
assertTrue(btn.isDefaultButton());
}

@Test public void defaultButtonPropertyHasBeanReference() {
Expand Down Expand Up @@ -346,10 +356,21 @@ private void show() {
tk.firePulse();
}

@Ignore("impl_cssSet API removed")
@Test public void cannotSpecifyCancelButtonViaCSS() {
// btn.impl_cssSet("-fx-cancel-button", true);
// By default, 'btn' is not a cancel button
// Making it a cancel button via CSS should not succeed
btn.setStyle("-fx-cancel-button: true;");
btn.applyCss();
assertFalse(btn.isCancelButton());

// Make button a cancel-button
btn.setCancelButton(true);
assertTrue(btn.isCancelButton());

// Making it a non-cancel button via CSS should not succeed
btn.setStyle("-fx-cancel-button: false;");
btn.applyCss();
assertTrue(btn.isCancelButton());
}

@Test public void cancelButtonPropertyHasBeanReference() {
Expand Down Expand Up @@ -410,7 +431,6 @@ private void show() {
MenuItem item1 = new MenuItem("_About");
popupMenu.getItems().add(item1);
popupMenu.setOnShown(w -> {
System.out.println("popup shown");
count++;
});

Expand Down

0 comments on commit 1971c70

Please sign in to comment.