~ubuntu-branches/ubuntu/natty/adblock-plus/natty

« back to all changes in this revision

Viewing changes to chrome/content/mochitest/tests/performance/elemhide_selectors.html

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-11-05 18:42:36 UTC
  • mto: (25.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: james.westby@ubuntu.com-20101105184236-h7dnu8mbfjaoya62
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<html>
3
3
<head>
4
4
  <title>Element hiding performance measurements</title>
 
5
 
 
6
  <script type="application/x-javascript;version=1.7" src="../common.js"></script>
5
7
</head>
6
8
<body>
7
9
  <p id="progress">Please wait while performance measurement is in progress... <span id="current"></span></p>
11
13
  <pre id="result"></pre>
12
14
 
13
15
  <script type="application/x-javascript;version=1.7">
14
 
    let abp = Components.classes["@mozilla.org/adblockplus;1"].createInstance().wrappedJSObject;
 
16
    prepareFilterComponents();
 
17
    preparePrefs();
15
18
 
16
19
    let selectors = ['#foo', '.foo', '*#foo', '*.foo', '[id="foo"]', '*[id="foo"]', '[class~="foo"]', '*[class~="foo"]', '[id^="foo"]', '[id*="foo"]', '[id$="foo"]'];
17
20
    let currentSelector = -1;
48
51
          document.getElementById("current").textContent = "Processing selector " + (currentSelector + 1) + " out of " + selectors.length;
49
52
 
50
53
        count = 0;
51
 
        abp.elemhide.clear();
 
54
        ElemHide.clear();
52
55
      }
53
56
      else
54
57
      {
55
58
        let max = count + 50;
56
59
        for (; count < max; count++)
57
 
          abp.elemhide.add(abp.Filter.fromText("mochikit##" + selectors[currentSelector].replace("foo", "foo" + count)));
 
60
          ElemHide.add(Filter.fromText("mochikit##" + selectors[currentSelector].replace("foo", "foo" + count)));
58
61
      }
59
 
      abp.elemhide.apply();
 
62
      ElemHide.apply();
60
63
 
61
64
      startTime = Date.now();
62
 
      document.getElementById("frame").contentWindow.location.href = "elemhide_selectors_testdata.html";
 
65
      document.getElementById("frame").contentWindow.location.href = "data/elemhide_selectors_testdata.html";
63
66
    }
64
67
  </script>
65
68
</body>
66
 
</html>
 
 
b'\\ No newline at end of file'
 
69
</html>