File: karma.context.html

package info (click to toggle)
jquery 3.3.1~dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 2,284 kB
  • sloc: php: 200; sh: 55; xml: 36; makefile: 33
file content (45 lines) | stat: -rw-r--r-- 1,519 bytes parent folder | download | duplicates (2)
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
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en" id="html">
<head>
  <meta charset="utf-8">
  <title>CONTEXT</title>
  <!-- Karma serves this page from /context.html. Other files are served from /base -->
  <link rel="stylesheet" href="/base/test/data/testsuite.css" />
</head>
<body id="body">
  <div id="qunit"></div>

  <!-- Start: jQuery Test HTML -->
  <!-- this iframe is outside the #qunit-fixture so it won't waste time by constantly reloading; the tests are "safe" and clean up after themselves -->
  <iframe id="loadediframe" name="loadediframe" style="display:none;" src="/base/test/data/iframe.html"></iframe>
  <div id="qunit-fixture"></div>
  <!-- End: jQuery Test HTML -->

  <!-- Start: Karma boilerplate -->
  <script src="/context.js"></script>
  <script>
    %CLIENT_CONFIG%
    window.__karma__.setupContext(window);

    %MAPPINGS%
  </script>
  %SCRIPTS%
  <!-- End: Karma boilerplate -->

  <script src="/base/test/data/qunit-fixture.js"></script>
  <script>
    // Workaround: Remove call to window.__karma__.loaded()
    // in favour of calling window.__karma__.start() at window.onload
    // because tests such as unit/ready.js should run after document ready
    window.addEventListener('load', function() {
      window.__karma__.start();

      // Workaround: https://github.com/karma-runner/karma-qunit/issues/92
      QUnit.testStart(function () {
        // Restore content
        document.getElementById("qunit-fixture").innerHTML = QUnit.config.fixture;
      });
    });
  </script>
</body>
</html>