fune/devtools/client/webreplay/mochitest/browser_dbg_rr_replay-03.js
Brian Hackett 1290999d83 Bug 1517837 - Move web replay tests to their own directory, r=lsmyth.
--HG--
extra : rebase_source : f26c786e9f787a57faed62f54c59178a5067065f
2019-01-15 12:26:20 -10:00

36 lines
1.4 KiB
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-disable no-undef */
"use strict";
// To disable all Web Replay tests, see browser.ini
// Test for saving a recording and then replaying it in a new tab,
// with rewinding disabled.
add_task(async function() {
await pushPref("devtools.recordreplay.enableRewinding", false);
const recordingFile = newRecordingFile();
const recordingTab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
gBrowser.selectedTab = recordingTab;
openTrustedLinkIn(EXAMPLE_URL + "doc_rr_basic.html", "current");
await once(Services.ppmm, "RecordingFinished");
const tabParent = recordingTab.linkedBrowser.frameLoader.tabParent;
ok(tabParent, "Found recording tab parent");
ok(tabParent.saveRecording(recordingFile), "Saved recording");
await once(Services.ppmm, "SaveRecordingFinished");
const replayingTab = BrowserTestUtils.addTab(gBrowser, null,
{ replayExecution: recordingFile });
gBrowser.selectedTab = replayingTab;
await once(Services.ppmm, "HitRecordingEndpoint");
ok(true, "Replayed to end of recording");
await gBrowser.removeTab(recordingTab);
await gBrowser.removeTab(replayingTab);
});