fune/devtools/server/tests/browser/browser_markers-docloading-02.js
J. Ryan Stinnett 30b2b7ce44 Bug 1271084 - Apply ESLint autofixes to ignored /devtools files. r=tromey
For simple rules like function spacing, we can auto-fix these across the code
base so they are followed in a consistent way.

To generate this patch, I ran:

./mach eslint devtools --no-ignore --fix

After this, I reverted any changes to third party files that we really do want
to ignore.

MozReview-Commit-ID: 6Q8BApkAW20
2016-05-18 12:49:23 -05:00

35 lines
1.1 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that we get DOMContentLoaded and Load markers
*/
const { TimelineFront } = require("devtools/server/actors/timeline");
const MARKER_NAMES = ["document::DOMContentLoaded", "document::Load"];
add_task(function* () {
let browser = yield addTab(MAIN_DOMAIN + "doc_innerHTML.html");
let doc = browser.contentDocument;
initDebuggerServer();
let client = new DebuggerClient(DebuggerServer.connectPipe());
let form = yield connectDebuggerClient(client);
let front = TimelineFront(client, form);
let rec = yield front.start({ withMarkers: true, withDocLoadingEvents: true });
yield new Promise(resolve => {
front.once("doc-loading", resolve);
doc.location.reload();
});
ok(true, "At least one doc-loading event got fired.");
yield waitForMarkerType(front, MARKER_NAMES, () => true, e => e, "markers");
yield front.stop(rec);
ok(true, "Found the required marker names.");
yield closeDebuggerClient(client);
gBrowser.removeCurrentTab();
});