Skip to content

Commit e657fcb

Browse files
committed
Change test_evalute_Cookies to compare against set cookies
Issue #2804 uncovers some weirdness of the test - set the cookie and verify it's not set after that, this simply doesn't make sense. Changed to test for the values being actually set.
1 parent a0d6ffc commit e657fcb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,17 @@ public void test_evalute_Cookies () {
410410

411411
// Set the cookies
412412
// document.cookie behaves different from other global vars
413-
browser.evaluate("document.cookie = \"cookie1=value1\";");
414-
browser.evaluate("document.cookie = \"cookie2=value2\";");
413+
browser.evaluate("""
414+
document.cookie = "cookie1=value1";
415+
""");
416+
browser.evaluate("""
417+
document.cookie = "cookie2=value2";
418+
""");
415419

416420
// Retrieve entire cookie store
417421
String res = (String) browser.evaluate("return document.cookie;");
418422

419-
assertFalse(res.isEmpty());
423+
assertEquals("cookie1=value1; cookie2=value2", res);
420424
}
421425

422426
@Tag("gtk4-todo")

0 commit comments

Comments
 (0)