diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-13 19:39:30 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-13 19:39:30 +0100 |
commit | 95ad4639a36f1050ce823332b4a38583d45c0c11 (patch) | |
tree | cdf9c6a742f03d75f746f7ecaa6dc9ddf540328a /testlib/selenium/testhost.html | |
parent | 095b19aeb400a4d1da031856a93a3e23b5c743bc (diff) | |
download | wallet-core-95ad4639a36f1050ce823332b4a38583d45c0c11.tar.xz |
don't instrument emscripten output
Diffstat (limited to 'testlib/selenium/testhost.html')
-rw-r--r-- | testlib/selenium/testhost.html | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/testlib/selenium/testhost.html b/testlib/selenium/testhost.html index b75c99e7e..5733ad945 100644 --- a/testlib/selenium/testhost.html +++ b/testlib/selenium/testhost.html @@ -10,7 +10,11 @@ <!-- for instrumentation to work, we have to use the non-csp version --> <script src="/testlib/selenium/system.js"></script> + </head> + <body> <script> + document.body.appendChild(document.createTextNode(`starting test`)); + document.body.appendChild(document.createElement("br")); var requestCoverage = false; @@ -18,17 +22,26 @@ let oldTranslate = System.translate.bind(System); System.translate = (load) => { + let srcP = oldTranslate(load); if (!requestCoverage) { - return oldTranslate(load); + return srcP; } - let inst = new Instrumenter(); - let srcP = oldTranslate(load); - console.dir(load); + parser.href = load.name; + let modName = parser.pathname.substring(1); + + if (/.*\/?taler-emscripten-lib.js/.test(load.name)) { + // don't instrument emscripten + document.body.appendChild(document.createTextNode(`not instrumenting ${modName}`)); + document.body.appendChild(document.createElement("br")); + return srcP; + } + + let inst = new Instrumenter(); + document.body.appendChild(document.createTextNode(`instrumenting ${modName}`)); + document.body.appendChild(document.createElement("br")); return Promise.resolve(srcP).then((src) => { - parser.href = load.name; - let modName = parser.pathname.substring(1); return inst.instrumentSync(src, modName); }); } @@ -44,5 +57,5 @@ }, }); </script> - </head> + </body> </html> |