summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/same-site-cookies/resources/util.js
blob: 67d9ee5c06bfd23f4a0e1cf28089318866f8c071 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
async function getCookieNames() {
  const cookies = await test_driver.get_all_cookies();
  const cookie_names = {};
  cookies.forEach((element) => cookie_names[element["name"]] = true);
  let message = ",SetOnRedirectLoad:";
  if (cookie_names.hasOwnProperty("samesite_strict_set_on_redirect_load")) {
    message += "Strict";
  }
  if (cookie_names.hasOwnProperty("samesite_lax_set_on_redirect_load")) {
      message += "Lax";
  }
  if (cookie_names.hasOwnProperty("samesite_none_set_on_redirect_load")) {
      message += "None";
  }
  message += ",SetOnLoad:";
  if (cookie_names.hasOwnProperty("samesite_strict_set_on_load")) {
    message += "Strict";
  }
  if (cookie_names.hasOwnProperty("samesite_lax_set_on_load")) {
      message += "Lax";
  }
  if (cookie_names.hasOwnProperty("samesite_none_set_on_load")) {
      message += "None";
  }
  message += ",SetOnRedirectFetch:";
  if (cookie_names.hasOwnProperty("samesite_strict_set_on_redirect_fetch")) {
    message += "Strict";
  }
  if (cookie_names.hasOwnProperty("samesite_lax_set_on_redirect_fetch")) {
      message += "Lax";
  }
  if (cookie_names.hasOwnProperty("samesite_none_set_on_redirect_fetch")) {
      message += "None";
  }
  message += ",SetOnFetch:";
  if (cookie_names.hasOwnProperty("samesite_strict_set_on_fetch")) {
    message += "Strict";
  }
  if (cookie_names.hasOwnProperty("samesite_lax_set_on_fetch")) {
      message += "Lax";
  }
  if (cookie_names.hasOwnProperty("samesite_none_set_on_fetch")) {
      message += "None";
  }
  return message;
}