chromium/third_party/blink/web_tests/fast/innerHTML/innerHTML-uri-resolution.html

<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<div id="container"></div>
<script>
  description('Checks that URIs used in styles that are set via innerHTML are resolved against the current document\'s base URI.');
  
  document.getElementById('container').innerHTML = 
      '<span id="test-span" style="background-image: url(image.png)"></span>';
  
  var currentUri = document.location.href;
  var currentPath = currentUri.substring(0, currentUri.lastIndexOf('/'));
  var cssUriWasResolvedAgainstDocumentUri = document.getElementById("test-span").style.backgroundImage == 'url("image.png")';
  
  // Can't log the actual path since it's different depending on where the test is run.
  shouldBeTrue('cssUriWasResolvedAgainstDocumentUri');
</script>
</body>
</html>