summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/chrome_extension_resource.html
blob: 3bc87723c2d24fc268852365900b81d7114340cd (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
<html>
<head>
<script>
var xhrStatus = -1;
var imgUrl = 'chrome-extension://eemcgdkfndhakfknompkggombfjjjeno/images/bookmark_manager_search.png';

window.onload = function() {
  // The call to pushState with chrome-extension:// URL will succeed, since the
  // test uses --disable-web-security.
  history.pushState('', '',
      'chrome-extension://eemcgdkfndhakfknompkggombfjjjeno/main.html');
  var xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function() {
    if (xhr.readyState == 4) {
      xhrStatus = xhr.status;    
      if (xhrStatus == 200) {
        document.getElementById('star').src =
            window.URL.createObjectURL(this.response);
      }
      domAutomationController.setAutomationId(0);
      domAutomationController.send(xhr.status);
    }
  }
  xhr.open('GET', imgUrl);
  xhr.responseType = 'blob';
  xhr.send();
}
</script>
</head>
<body>
<img id='star'>
</body>
</html>