Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8336334

[TestBug] Data URL Utility in Tests

XMLWordPrintable

    • Fix Understood

      Whenever the test requires a CSS stylesheet, we could use a generated data URL. Also, a number of tests do use the data URL.
      What we should do is to create a utility to convert String to data URL.

      public static String toDataUrl(String css) {
        return "data:base64," + Base64.getUrlEncoder().encodeToString(css.getBytes(StandardCharsets.UTF_8));
      }

      (Came out of a discussion in https://github.com/openjdk/jfx/pull/1394)

            angorya Andy Goryachev
            angorya Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: