summaryrefslogtreecommitdiff
path: root/toolkit/devtools/timeline/test/browser_timeline_waterfall-generic.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
committerMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
commit81805ce3f63e2e4a799bd54f174083c58a9b5640 (patch)
tree6e13374b213ac9b2ae74c25d8aac875faf71fdd0 /toolkit/devtools/timeline/test/browser_timeline_waterfall-generic.js
parent28c8da71bf521bb3ee76f27b8a241919e24b7cd5 (diff)
downloadpalemoon-gre-81805ce3f63e2e4a799bd54f174083c58a9b5640.tar.gz
Move Mozilla DevTools to Platform - Part 3: Merge the browser/devtools and toolkit/devtools adjusting for directory collisions
Diffstat (limited to 'toolkit/devtools/timeline/test/browser_timeline_waterfall-generic.js')
-rw-r--r--toolkit/devtools/timeline/test/browser_timeline_waterfall-generic.js65
1 files changed, 65 insertions, 0 deletions
diff --git a/toolkit/devtools/timeline/test/browser_timeline_waterfall-generic.js b/toolkit/devtools/timeline/test/browser_timeline_waterfall-generic.js
new file mode 100644
index 000000000..ceff2bd1f
--- /dev/null
+++ b/toolkit/devtools/timeline/test/browser_timeline_waterfall-generic.js
@@ -0,0 +1,65 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests if the waterfall is properly built after finishing a recording.
+ */
+
+add_task(function*() {
+ let { target, panel } = yield initTimelinePanel(SIMPLE_URL);
+ let { $, $$, EVENTS, TimelineController } = panel.panelWin;
+
+ yield TimelineController.toggleRecording();
+ ok(true, "Recording has started.");
+
+ let updated = 0;
+ panel.panelWin.on(EVENTS.OVERVIEW_UPDATED, () => updated++);
+
+ ok((yield waitUntil(() => updated > 0)),
+ "The overview graphs were updated a bunch of times.");
+ ok((yield waitUntil(() => TimelineController.getMarkers().length > 0)),
+ "There are some markers available.");
+
+ yield TimelineController.toggleRecording();
+ ok(true, "Recording has ended.");
+
+ // Test the header container.
+
+ ok($(".waterfall-header-container"),
+ "A header container should have been created.");
+
+ // Test the header sidebar (left).
+
+ ok($(".waterfall-header-container > .waterfall-sidebar"),
+ "A header sidebar node should have been created.");
+ ok($(".waterfall-header-container > .waterfall-sidebar > .waterfall-header-name"),
+ "A header name label should have been created inside the sidebar.");
+
+ // Test the header ticks (right).
+
+ ok($(".waterfall-header-ticks"),
+ "A header ticks node should have been created.");
+ ok($$(".waterfall-header-ticks > .waterfall-header-tick").length > 0,
+ "Some header tick labels should have been created inside the tick node.");
+
+ // Test the markers container.
+
+ ok($(".waterfall-marker-container"),
+ "A marker container should have been created.");
+
+ // Test the markers sidebar (left).
+
+ ok($$(".waterfall-marker-container > .waterfall-sidebar").length,
+ "Some marker sidebar nodes should have been created.");
+ ok($$(".waterfall-marker-container > .waterfall-sidebar:not(spacer) > .waterfall-marker-bullet").length,
+ "Some marker color bullets should have been created inside the sidebar.");
+ ok($$(".waterfall-marker-container > .waterfall-sidebar:not(spacer) > .waterfall-marker-name").length,
+ "Some marker name labels should have been created inside the sidebar.");
+
+ // Test the markers waterfall (right).
+
+ ok($$(".waterfall-marker-item").length,
+ "Some marker waterfall nodes should have been created.");
+ ok($$(".waterfall-marker-item:not(spacer) > .waterfall-marker-bar").length,
+ "Some marker color bars should have been created inside the waterfall.");
+});