summaryrefslogtreecommitdiffstats
path: root/devtools/server/tests/browser/browser_markers-docloading-02.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/server/tests/browser/browser_markers-docloading-02.js')
-rw-r--r--devtools/server/tests/browser/browser_markers-docloading-02.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/devtools/server/tests/browser/browser_markers-docloading-02.js b/devtools/server/tests/browser/browser_markers-docloading-02.js
new file mode 100644
index 000000000..0142ea0cd
--- /dev/null
+++ b/devtools/server/tests/browser/browser_markers-docloading-02.js
@@ -0,0 +1,35 @@
+/* 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/shared/fronts/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 client.close();
+ gBrowser.removeCurrentTab();
+});