summaryrefslogtreecommitdiffstats
path: root/testing/talos/talos/tests/perf-reftest-singletons/external-string-pass.html
blob: 459dacab0b82622f5761d86c7dafd5ad0652d3ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!doctype html>
<script src="util.js"></script>
<script>
  onload = function() {
      var str = new Array(1e6).join("a");
      var div = document.createElement("div");
      // Round-trip through the DOM to make sure we have an external string.
      div.setAttribute("x", str);
      str = div.getAttribute("x");
      var count = 3e7;  // About 1s
      var t = new DataTransfer();
      perf_start();
      for (let i = count; i > 0; --i) {
          t.dropEffect = str;
      }
      perf_finish();
  };
</script>