Bug 1164338 - Tests that the style markers have restyleHints. r=pbrosset, a=sledru
authorJordan Santell <jsantell@mozilla.com>
Mon, 18 May 2015 19:24:23 -0700
changeset 274838 903c90590b5da28414551b5ee57ae67c8376511d
parent 274837 668917d1cb31732393efab01fa2583a315c81276
child 274839 874dfde6ee0b0132c1dba0bc5df3f276e2387cc1
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbrosset, sledru
bugs1164338
milestone40.0a2
Bug 1164338 - Tests that the style markers have restyleHints. r=pbrosset, a=sledru
browser/devtools/performance/test/browser.ini
browser/devtools/performance/test/browser_markers-styles.js
--- a/browser/devtools/performance/test/browser.ini
+++ b/browser/devtools/performance/test/browser.ini
@@ -9,16 +9,17 @@ support-files =
 
 # Commented out tests are profiler tests
 # that need to be moved over to performance tool
 
 [browser_perf-aaa-run-first-leaktest.js]
 [browser_marker-utils.js]
 [browser_markers-gc.js]
 [browser_markers-parse-html.js]
+[browser_markers-styles.js]
 [browser_markers-timestamp.js]
 [browser_perf-allocations-to-samples.js]
 [browser_perf-categories-js-calltree.js]
 [browser_perf-compatibility-01.js]
 [browser_perf-compatibility-02.js]
 [browser_perf-compatibility-03.js]
 [browser_perf-compatibility-04.js]
 [browser_perf-compatibility-05.js]
new file mode 100644
--- /dev/null
+++ b/browser/devtools/performance/test/browser_markers-styles.js
@@ -0,0 +1,38 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Test that we get a "Styles" marker with the correct meta.
+ */
+
+
+function* spawnTest () {
+  let { target, front } = yield initBackend(SIMPLE_URL);
+  let markers = [];
+
+  front.on("timeline-data", handler);
+  let model = yield front.startRecording({ withTicks: true });
+
+  yield waitUntil(() => {
+    return markers.some(({restyleHint}) => restyleHint != void 0);
+  });
+
+  front.off("timeline-data", handler);
+  yield front.stopRecording(model);
+
+  info(`Got ${markers.length} markers.`);
+
+  ok(markers.every(({name}) => name === "Styles"), "All markers found are Styles markers");
+  ok(markers.length, "found some restyle markers");
+
+  ok(markers.some(({restyleHint}) => restyleHint != void 0), "some markers have a restyleHint property");
+
+  yield removeTab(target.tab);
+  finish();
+
+  function handler (_, name, m) {
+    if (name === "markers") {
+      markers = markers.concat(m.filter(marker => marker.name === "Styles"));
+    }
+  }
+}