2525
2626public class TestBrowserContextCredentials extends TestBase {
2727
28- static boolean isChromiumHeadful () {
29- return isChromium () && isHeadful ();
28+ static boolean isChromiumHeadedLike () {
29+ // --headless=new, the default in all Chromium channels, is like headless.
30+ return isChromium () && (isHeadful () || getBrowserChannelFromEnv () != null );
3031 }
3132
32- static boolean isChromiumChannel () {
33- // net::ERR_INVALID_AUTH_CREDENTIALS is thrown in --headless=new which
34- // is the default in all Chromium channels.
35- return isChromium () && getBrowserChannelFromEnv () != null ;
36- }
37-
38-
3933 @ Test
40- @ DisabledIf (value ="isChromiumHeadful " , disabledReason ="fail" )
34+ @ DisabledIf (value ="isChromiumHeadedLike " , disabledReason ="fail" )
4135 void shouldFailWithoutCredentials () {
36+ System .out .println ("channel2 " + getBrowserChannelFromEnv ());
4237 server .setAuth ("/empty.html" , "user" , "pass" );
4338 Response response = page .navigate (server .EMPTY_PAGE );
4439 assertEquals (401 , response .status ());
@@ -110,6 +105,7 @@ void shouldWorkWithCorrectCredentialsAndMatchingOriginCaseInsensitive() {
110105 }
111106
112107 @ Test
108+ @ DisabledIf (value ="isChromiumHeadedLike" , disabledReason ="fail" )
113109 void shouldFailWithCorrectCredentialsAndWrongOriginScheme () {
114110 server .setAuth ("/empty.html" , "user" , "pass" );
115111 final HttpCredentials httpCredentials = new HttpCredentials ("user" , "pass" );
@@ -122,6 +118,7 @@ void shouldFailWithCorrectCredentialsAndWrongOriginScheme() {
122118 }
123119
124120 @ Test
121+ @ DisabledIf (value ="isChromiumHeadedLike" , disabledReason ="fail" )
125122 void shouldFailWithCorrectCredentialsAndWrongOriginHostname () {
126123 server .setAuth ("/empty.html" , "user" , "pass" );
127124 final HttpCredentials httpCredentials = new HttpCredentials ("user" , "pass" );
@@ -134,6 +131,7 @@ void shouldFailWithCorrectCredentialsAndWrongOriginHostname() {
134131 }
135132
136133 @ Test
134+ @ DisabledIf (value ="isChromiumHeadedLike" , disabledReason ="fail" )
137135 void shouldFailWithCorrectCredentialsAndWrongOriginPort () {
138136 server .setAuth ("/empty.html" , "user" , "pass" );
139137 final HttpCredentials httpCredentials = new HttpCredentials ("user" , "pass" );
0 commit comments