devtools/client/debugger/new/test/mochitest/examples/doc_rr_basic.html
author Coroiu Cristina <ccoroiu@mozilla.com>
Tue, 15 Jan 2019 23:07:50 +0200
changeset 511129 5e5b06dcc0c021a16df0a9a57d93a4b14b895e8b
parent 511114 devtools/client/webreplay/mochitest/examples/doc_rr_basic.html@a0b8e8c08c8d2fe95c24c26e2160ce57077355fe
child 511142 e4ac2508e8edc50da4bf7ed30803338a81ba026c
permissions -rw-r--r--
Backed out changeset a0b8e8c08c8d (bug 1517837) for devtools failures at devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-01.js

<html lang="en" dir="ltr">
<body>
<div id="maindiv" style="padding-top:50px">Hello World!</div>
</body>
<script>
const cpmm = SpecialPowers.Services.cpmm;
function recordingFinished() {
  cpmm.sendAsyncMessage("RecordingFinished");
}
var number = 0;
function f() {
  updateNumber();
  if (number >= 10) {
    window.setTimeout(recordingFinished);
    return;
  }
  window.setTimeout(f, 1);
}
function updateNumber() {
  number++;
  document.getElementById("maindiv").innerHTML = "Number: " + number;
  testStepping();
}
function testStepping() {
  var a = 0;
  testStepping2();
  return a;
}
function testStepping2() {
  var c = this; // Note: using 'this' causes the script to have a prologue.
  c++;
  c--;
}
window.setTimeout(f, 1);
// Simulate a longer recording by marking major checkpoints whenever possible.
SpecialPowers.Cu.recordReplayDirective(/* AlwaysMarkMajorCheckpoints */ 4);
</script>
</html>