-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1101235-migrate-profiler.patch
1206 lines (1024 loc) · 49.3 KB
/
1101235-migrate-profiler.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# HG changeset patch
# User Jordan Santell <[email protected]>
# Date 1423686212 28800
# Wed Feb 11 12:23:32 2015 -0800
# Node ID 585550948e3291413c724bea82cec9d218f47c05
# Parent 38a668c3efaa990ab0585749f21b4ccc76fe71cc
[mq]: 1101235
diff --git a/browser/devtools/performance/performance-controller.js b/browser/devtools/performance/performance-controller.js
--- a/browser/devtools/performance/performance-controller.js
+++ b/browser/devtools/performance/performance-controller.js
@@ -13,37 +13,37 @@ Cu.import("resource:///modules/devtools/
devtools.lazyRequireGetter(this, "Services");
devtools.lazyRequireGetter(this, "promise");
devtools.lazyRequireGetter(this, "EventEmitter",
"devtools/toolkit/event-emitter");
devtools.lazyRequireGetter(this, "DevToolsUtils",
"devtools/toolkit/DevToolsUtils");
devtools.lazyRequireGetter(this, "TIMELINE_BLUEPRINT",
- "devtools/timeline/global", true);
+ "devtools/shared/timeline/global", true);
devtools.lazyRequireGetter(this, "L10N",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
devtools.lazyRequireGetter(this, "RecordingUtils",
"devtools/performance/recording-utils", true);
devtools.lazyRequireGetter(this, "RecordingModel",
"devtools/performance/recording-model", true);
devtools.lazyRequireGetter(this, "MarkersOverview",
- "devtools/timeline/markers-overview", true);
+ "devtools/shared/timeline/markers-overview", true);
devtools.lazyRequireGetter(this, "MemoryOverview",
- "devtools/timeline/memory-overview", true);
+ "devtools/shared/timeline/memory-overview", true);
devtools.lazyRequireGetter(this, "Waterfall",
- "devtools/timeline/waterfall", true);
+ "devtools/shared/timeline/waterfall", true);
devtools.lazyRequireGetter(this, "MarkerDetails",
- "devtools/timeline/marker-details", true);
+ "devtools/shared/timeline/marker-details", true);
devtools.lazyRequireGetter(this, "CallView",
- "devtools/profiler/tree-view", true);
+ "devtools/shared/profiler/tree-view", true);
devtools.lazyRequireGetter(this, "ThreadNode",
- "devtools/profiler/tree-model", true);
+ "devtools/shared/profiler/tree-model", true);
devtools.lazyRequireGetter(this, "FrameNode",
- "devtools/profiler/tree-model", true);
+ "devtools/shared/profiler/tree-model", true);
devtools.lazyRequireGetter(this, "OptionsView",
"devtools/shared/options-view", true);
devtools.lazyImporter(this, "CanvasGraphUtils",
"resource:///modules/devtools/Graphs.jsm");
devtools.lazyImporter(this, "LineGraphWidget",
"resource:///modules/devtools/Graphs.jsm");
devtools.lazyImporter(this, "FlameGraphUtils",
diff --git a/browser/devtools/performance/test/browser.ini b/browser/devtools/performance/test/browser.ini
--- a/browser/devtools/performance/test/browser.ini
+++ b/browser/devtools/performance/test/browser.ini
@@ -68,8 +68,28 @@ support-files =
[browser_perf_recordings-io-02.js]
[browser_perf_recordings-io-03.js]
[browser_perf_recordings-io-04.js]
# [browser_perf-range-changed-render.js] bug 1130669 crash
[browser_perf-recording-selected-01.js]
[browser_perf-recording-selected-02.js]
[browser_perf-recording-selected-03.js]
[browser_perf-recording-selected-04.js]
+[browser_profiler_categories.js]
+[browser_profiler_content-check.js]
+[browser_profiler_tree-abstract-01.js]
+[browser_profiler_tree-abstract-02.js]
+[browser_profiler_tree-abstract-03.js]
+[browser_profiler_tree-abstract-04.js]
+[browser_profiler_tree-frame-node.js]
+[browser_profiler_tree-model-01.js]
+[browser_profiler_tree-model-02.js]
+[browser_profiler_tree-model-03.js]
+[browser_profiler_tree-model-04.js]
+[browser_profiler_tree-model-05.js]
+[browser_profiler_tree-view-01.js]
+[browser_profiler_tree-view-02.js]
+[browser_profiler_tree-view-03.js]
+[browser_profiler_tree-view-04.js]
+[browser_profiler_tree-view-05.js]
+[browser_profiler_tree-view-06.js]
+[browser_profiler_tree-view-07.js]
+[browser_timeline_blueprint.js]
diff --git a/browser/devtools/performance/test/browser_perf-events-calltree.js b/browser/devtools/performance/test/browser_perf-events-calltree.js
--- a/browser/devtools/performance/test/browser_perf-events-calltree.js
+++ b/browser/devtools/performance/test/browser_perf-events-calltree.js
@@ -1,15 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that the call tree up/down events work for js calltree and memory calltree.
*/
-let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
+let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
function spawnTest () {
let focus = 0;
let focusEvent = () => focus++;
Services.prefs.setBoolPref(MEMORY_PREF, true);
let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, DetailsView, JsCallTreeView, MemoryCallTreeView } = panel.panelWin;
diff --git a/browser/devtools/profiler/test/browser_profiler_categories.js b/browser/devtools/performance/test/browser_profiler_categories.js
rename from browser/devtools/profiler/test/browser_profiler_categories.js
rename to browser/devtools/performance/test/browser_profiler_categories.js
--- a/browser/devtools/profiler/test/browser_profiler_categories.js
+++ b/browser/devtools/performance/test/browser_profiler_categories.js
@@ -1,17 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the profiler categories are mapped correctly.
*/
function test() {
- let global = devtools.require("devtools/profiler/global");
+ let global = devtools.require("devtools/shared/profiler/global");
let l10n = global.L10N;
let categories = global.CATEGORIES;
let mappings = global.CATEGORY_MAPPINGS;
let count = categories.length;
ok(count,
"Should have a non-empty list of categories available.");
diff --git a/browser/devtools/profiler/test/browser_profiler_content-check.js b/browser/devtools/performance/test/browser_profiler_content-check.js
rename from browser/devtools/profiler/test/browser_profiler_content-check.js
rename to browser/devtools/performance/test/browser_profiler_content-check.js
--- a/browser/devtools/profiler/test/browser_profiler_content-check.js
+++ b/browser/devtools/performance/test/browser_profiler_content-check.js
@@ -2,17 +2,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests the function testing whether or not a frame is content or chrome
* works properly.
*/
function test() {
- let { FrameNode } = devtools.require("devtools/profiler/tree-model");
+ let { FrameNode } = devtools.require("devtools/shared/profiler/tree-model");
ok(FrameNode.isContent({ location: "http://foo" }),
"Verifying content/chrome frames is working properly.");
ok(FrameNode.isContent({ location: "https://foo" }),
"Verifying content/chrome frames is working properly.");
ok(FrameNode.isContent({ location: "file://foo" }),
"Verifying content/chrome frames is working properly.");
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-abstract-01.js b/browser/devtools/performance/test/browser_profiler_tree-abstract-01.js
rename from browser/devtools/profiler/test/browser_profiler_tree-abstract-01.js
rename to browser/devtools/performance/test/browser_profiler_tree-abstract-01.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-abstract-01.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-abstract-01.js
@@ -4,17 +4,17 @@
/**
* Tests if the abstract tree base class for the profiler's tree view
* works as advertised.
*/
let { AbstractTreeItem } = Cu.import("resource:///modules/devtools/AbstractTreeItem.jsm", {});
let { Heritage } = Cu.import("resource:///modules/devtools/ViewHelpers.jsm", {});
-let test = Task.async(function*() {
+function spawnTest () {
let container = document.createElement("vbox");
gBrowser.selectedBrowser.parentNode.appendChild(container);
// Populate the tree and test the root item...
let treeRoot = new MyCustomTreeItem(gDataSrc, { parent: null });
treeRoot.attachTo(container);
@@ -130,17 +130,17 @@ let test = Task.async(function*() {
"The 'baz' node's indentation is correct.");
is(bazItem.target.textContent, "baz",
"The 'baz' node's text contents are correct.");
is(bazItem.container, container,
"The 'baz' node's container is correct.");
container.remove();
finish();
-});
+}
function MyCustomTreeItem(dataSrc, properties) {
AbstractTreeItem.call(this, properties);
this.itemDataSrc = dataSrc;
}
MyCustomTreeItem.prototype = Heritage.extend(AbstractTreeItem.prototype, {
_displaySelf: function(document, arrowNode) {
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-abstract-02.js b/browser/devtools/performance/test/browser_profiler_tree-abstract-02.js
rename from browser/devtools/profiler/test/browser_profiler_tree-abstract-02.js
rename to browser/devtools/performance/test/browser_profiler_tree-abstract-02.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-abstract-02.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-abstract-02.js
@@ -4,17 +4,17 @@
/**
* Tests if the abstract tree base class for the profiler's tree view
* has a functional public API.
*/
let { AbstractTreeItem } = Cu.import("resource:///modules/devtools/AbstractTreeItem.jsm", {});
let { Heritage } = Cu.import("resource:///modules/devtools/ViewHelpers.jsm", {});
-let test = Task.async(function*() {
+function spawnTest () {
let container = document.createElement("vbox");
gBrowser.selectedBrowser.parentNode.appendChild(container);
// Populate the tree and test `expand`, `collapse` and `getChild`...
let treeRoot = new MyCustomTreeItem(gDataSrc, { parent: null });
treeRoot.attachTo(container);
@@ -133,17 +133,17 @@ let test = Task.async(function*() {
"The root node should be the only in the container node.");
treeRoot.remove();
is(container.childNodes.length, 0,
"The container node should now have no children available.");
container.remove();
finish();
-});
+}
function MyCustomTreeItem(dataSrc, properties) {
AbstractTreeItem.call(this, properties);
this.itemDataSrc = dataSrc;
}
MyCustomTreeItem.prototype = Heritage.extend(AbstractTreeItem.prototype, {
_displaySelf: function(document, arrowNode) {
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-abstract-03.js b/browser/devtools/performance/test/browser_profiler_tree-abstract-03.js
rename from browser/devtools/profiler/test/browser_profiler_tree-abstract-03.js
rename to browser/devtools/performance/test/browser_profiler_tree-abstract-03.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-abstract-03.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-abstract-03.js
@@ -4,17 +4,17 @@
/**
* Tests if the abstract tree base class for the profiler's tree view
* is keyboard accessible.
*/
let { AbstractTreeItem } = Cu.import("resource:///modules/devtools/AbstractTreeItem.jsm", {});
let { Heritage } = Cu.import("resource:///modules/devtools/ViewHelpers.jsm", {});
-let test = Task.async(function*() {
+function spawnTest () {
let container = document.createElement("vbox");
gBrowser.selectedBrowser.parentNode.appendChild(container);
// Populate the tree by pressing RIGHT...
let treeRoot = new MyCustomTreeItem(gDataSrc, { parent: null });
treeRoot.attachTo(container);
treeRoot.focus();
@@ -141,17 +141,17 @@ let test = Task.async(function*() {
// Test UP on the root node.
EventUtils.sendKey("UP");
is(document.commandDispatcher.focusedElement, treeRoot.target,
"The root node is still focused.");
container.remove();
finish();
-});
+}
function MyCustomTreeItem(dataSrc, properties) {
AbstractTreeItem.call(this, properties);
this.itemDataSrc = dataSrc;
}
MyCustomTreeItem.prototype = Heritage.extend(AbstractTreeItem.prototype, {
_displaySelf: function(document, arrowNode) {
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-abstract-04.js b/browser/devtools/performance/test/browser_profiler_tree-abstract-04.js
rename from browser/devtools/profiler/test/browser_profiler_tree-abstract-04.js
rename to browser/devtools/performance/test/browser_profiler_tree-abstract-04.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-abstract-04.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-abstract-04.js
@@ -3,17 +3,17 @@
/**
* Tests that the treeview expander arrow doesn't react to dblclick events.
*/
let { AbstractTreeItem } = Cu.import("resource:///modules/devtools/AbstractTreeItem.jsm", {});
let { Heritage } = Cu.import("resource:///modules/devtools/ViewHelpers.jsm", {});
-let test = Task.async(function*() {
+function spawnTest () {
let container = document.createElement("vbox");
gBrowser.selectedBrowser.parentNode.appendChild(container);
// Populate the tree and test the root item...
let treeRoot = new MyCustomTreeItem(gDataSrc, { parent: null });
treeRoot.attachTo(container);
@@ -23,17 +23,17 @@ let test = Task.async(function*() {
EventUtils.sendMouseEvent({ type: "dblclick" }, treeRoot.target.querySelector(".arrow"));
yield receivedFocusEvent;
is(treeRoot.expanded, originalTreeRootExpanded,
"A double click on the arrow was ignored.");
container.remove();
finish();
-});
+}
function MyCustomTreeItem(dataSrc, properties) {
AbstractTreeItem.call(this, properties);
this.itemDataSrc = dataSrc;
}
MyCustomTreeItem.prototype = Heritage.extend(AbstractTreeItem.prototype, {
_displaySelf: function(document, arrowNode) {
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-frame-node.js b/browser/devtools/performance/test/browser_profiler_tree-frame-node.js
rename from browser/devtools/profiler/test/browser_profiler_tree-frame-node.js
rename to browser/devtools/performance/test/browser_profiler_tree-frame-node.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-frame-node.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-frame-node.js
@@ -1,17 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Verifies if FrameNodes retain and parse their data appropriately.
*/
function test() {
- let { FrameNode } = devtools.require("devtools/profiler/tree-model");
+ let { FrameNode } = devtools.require("devtools/shared/profiler/tree-model");
let frame1 = new FrameNode({
location: "hello/<.world (http://foo/bar.js:123:987)",
line: 456
});
is(frame1.getInfo().nodeType, "Frame",
"The first frame node has the correct type.");
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-model-01.js b/browser/devtools/performance/test/browser_profiler_tree-model-01.js
rename from browser/devtools/profiler/test/browser_profiler_tree-model-01.js
rename to browser/devtools/performance/test/browser_profiler_tree-model-01.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-model-01.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-01.js
@@ -1,17 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if a call tree model can be correctly computed from a samples array.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
// Create a root node from a given samples array.
let root = new ThreadNode(gSamples);
// Test the root node.
is(root.duration, 18,
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-model-02.js b/browser/devtools/performance/test/browser_profiler_tree-model-02.js
rename from browser/devtools/profiler/test/browser_profiler_tree-model-02.js
rename to browser/devtools/performance/test/browser_profiler_tree-model-02.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-model-02.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-02.js
@@ -1,17 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if a call tree model ignores samples with no timing information.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
// Create a root node from a given samples array.
let root = new ThreadNode(gSamples);
// Test the root node.
is(root.duration, 5,
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-model-03.js b/browser/devtools/performance/test/browser_profiler_tree-model-03.js
rename from browser/devtools/profiler/test/browser_profiler_tree-model-03.js
rename to browser/devtools/performance/test/browser_profiler_tree-model-03.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-model-03.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-03.js
@@ -2,17 +2,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if a call tree model can be correctly computed from a samples array,
* while at the same time filtering by duration.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
// Create a root node from a given samples array, filtering by time.
let root = new ThreadNode(gSamples, { startTime: 11, endTime: 18 });
// Test the root node.
is(root.duration, 18,
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-model-04.js b/browser/devtools/performance/test/browser_profiler_tree-model-04.js
rename from browser/devtools/profiler/test/browser_profiler_tree-model-04.js
rename to browser/devtools/performance/test/browser_profiler_tree-model-04.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-model-04.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-04.js
@@ -2,17 +2,17 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if a call tree model can be correctly computed from a samples array,
* while at the same time filtering by duration and content-only frames.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
// Create a root node from a given samples array, filtering by time.
let root = new ThreadNode(gSamples, { startTime: 11, endTime: 18, contentOnly: true });
// Test the root node.
is(root.duration, 18,
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-model-05.js b/browser/devtools/performance/test/browser_profiler_tree-model-05.js
rename from browser/devtools/profiler/test/browser_profiler_tree-model-05.js
rename to browser/devtools/performance/test/browser_profiler_tree-model-05.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-model-05.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-model-05.js
@@ -38,17 +38,17 @@ let samples = [{
{ location: "(root)" },
{ location: "A" },
{ location: "B" },
{ location: "F" }
]
}];
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
let root = new ThreadNode(samples, { invertTree: true });
is(Object.keys(root.calls).length, 2,
"Should get the 2 youngest frames, not the 1 oldest frame");
let C = root.calls.C;
ok(C, "Should have C as a child of the root.");
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-view-01.js b/browser/devtools/performance/test/browser_profiler_tree-view-01.js
rename from browser/devtools/profiler/test/browser_profiler_tree-view-01.js
rename to browser/devtools/performance/test/browser_profiler_tree-view-01.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-01.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-01.js
@@ -2,18 +2,18 @@
http://foo/bar/creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the profiler's tree view implementation works properly and
* creates the correct column structure.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
- let { CallView } = devtools.require("devtools/profiler/tree-view");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+ let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
let threadNode = new ThreadNode(gSamples);
let treeRoot = new CallView({ frame: threadNode });
let container = document.createElement("vbox");
treeRoot.autoExpandDepth = 0;
treeRoot.attachTo(container);
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-view-02.js b/browser/devtools/performance/test/browser_profiler_tree-view-02.js
rename from browser/devtools/profiler/test/browser_profiler_tree-view-02.js
rename to browser/devtools/performance/test/browser_profiler_tree-view-02.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-02.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-02.js
@@ -2,18 +2,18 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the profiler's tree view implementation works properly and
* creates the correct column structure after expanding some of the nodes.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
- let { CallView } = devtools.require("devtools/profiler/tree-view");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+ let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
let threadNode = new ThreadNode(gSamples);
let treeRoot = new CallView({ frame: threadNode });
let container = document.createElement("vbox");
treeRoot.autoExpandDepth = 0;
treeRoot.attachTo(container);
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-view-03.js b/browser/devtools/performance/test/browser_profiler_tree-view-03.js
rename from browser/devtools/profiler/test/browser_profiler_tree-view-03.js
rename to browser/devtools/performance/test/browser_profiler_tree-view-03.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-03.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-03.js
@@ -2,18 +2,18 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the profiler's tree view implementation works properly and
* creates the correct column structure and can auto-expand all nodes.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
- let { CallView } = devtools.require("devtools/profiler/tree-view");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+ let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
let threadNode = new ThreadNode(gSamples);
let treeRoot = new CallView({ frame: threadNode });
let container = document.createElement("vbox");
treeRoot.attachTo(container);
let $$fun = i => container.querySelectorAll(".call-tree-cell[type=function]")[i];
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-view-04.js b/browser/devtools/performance/test/browser_profiler_tree-view-04.js
rename from browser/devtools/profiler/test/browser_profiler_tree-view-04.js
rename to browser/devtools/performance/test/browser_profiler_tree-view-04.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-04.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-04.js
@@ -2,18 +2,18 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the profiler's tree view implementation works properly and
* creates the correct DOM nodes in the correct order.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
- let { CallView } = devtools.require("devtools/profiler/tree-view");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+ let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
let threadNode = new ThreadNode(gSamples);
let treeRoot = new CallView({ frame: threadNode });
let container = document.createElement("vbox");
treeRoot.attachTo(container);
is(treeRoot.target.getAttribute("origin"), "chrome",
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-view-05.js b/browser/devtools/performance/test/browser_profiler_tree-view-05.js
rename from browser/devtools/profiler/test/browser_profiler_tree-view-05.js
rename to browser/devtools/performance/test/browser_profiler_tree-view-05.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-05.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-05.js
@@ -2,18 +2,18 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the profiler's tree view implementation works properly and
* can toggle categories hidden or visible.
*/
function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
- let { CallView } = devtools.require("devtools/profiler/tree-view");
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+ let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
let threadNode = new ThreadNode(gSamples);
let treeRoot = new CallView({ frame: threadNode });
let container = document.createElement("vbox");
treeRoot.attachTo(container);
let categories = container.querySelectorAll(".call-tree-category");
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-view-06.js b/browser/devtools/performance/test/browser_profiler_tree-view-06.js
rename from browser/devtools/profiler/test/browser_profiler_tree-view-06.js
rename to browser/devtools/performance/test/browser_profiler_tree-view-06.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-06.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-06.js
@@ -1,19 +1,19 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the profiler's tree view implementation works properly and
* correctly emits events when certain DOM nodes are clicked.
*/
-let test = Task.async(function*() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
- let { CallView } = devtools.require("devtools/profiler/tree-view");
+function spawnTest () {
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+ let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
let threadNode = new ThreadNode(gSamples);
let treeRoot = new CallView({ frame: threadNode });
let container = document.createElement("vbox");
treeRoot.attachTo(container);
let A = treeRoot.getChild();
@@ -26,19 +26,18 @@ let test = Task.async(function*() {
let eventItem = yield receivedLinkEvent;
is(eventItem, D, "The 'link' event target is correct.");
let receivedZoomEvent = treeRoot.once("zoom");
EventUtils.sendMouseEvent({ type: "mousedown" }, D.target.querySelector(".call-tree-zoom"));
eventItem = yield receivedZoomEvent;
is(eventItem, D, "The 'zoom' event target is correct.");
-
finish();
-});
+}
let gSamples = [{
time: 5,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 16, location: "B (http://foo/bar/baz:34)" },
{ category: 32, location: "C (http://foo/bar/baz:56)" }
diff --git a/browser/devtools/profiler/test/browser_profiler_tree-view-07.js b/browser/devtools/performance/test/browser_profiler_tree-view-07.js
rename from browser/devtools/profiler/test/browser_profiler_tree-view-07.js
rename to browser/devtools/performance/test/browser_profiler_tree-view-07.js
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-07.js
+++ b/browser/devtools/performance/test/browser_profiler_tree-view-07.js
@@ -1,19 +1,19 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the profiler's tree view implementation works properly and
* has the correct 'root', 'parent', 'level' etc. accessors on child nodes.
*/
-function test() {
- let { ThreadNode } = devtools.require("devtools/profiler/tree-model");
- let { CallView } = devtools.require("devtools/profiler/tree-view");
+function spawnTest () {
+ let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
+ let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
let threadNode = new ThreadNode(gSamples);
let treeRoot = new CallView({ frame: threadNode });
let container = document.createElement("vbox");
container.id = "call-tree-container";
treeRoot.attachTo(container);
@@ -26,18 +26,16 @@ function test() {
is(D.parent, B,
"The .A.B.D node has the correct parent.");
is(D.level, 3,
"The .A.B.D node has the correct level.");
is(D.target.className, "call-tree-item",
"The .A.B.D node has the correct target node.");
is(D.container.id, "call-tree-container",
"The .A.B.D node has the correct container node.");
-
- finish();
}
let gSamples = [{
time: 5,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 16, location: "B (http://foo/bar/baz:34)" },
diff --git a/browser/devtools/timeline/test/browser_timeline_blueprint.js b/browser/devtools/performance/test/browser_timeline_blueprint.js
rename from browser/devtools/timeline/test/browser_timeline_blueprint.js
rename to browser/devtools/performance/test/browser_timeline_blueprint.js
--- a/browser/devtools/timeline/test/browser_timeline_blueprint.js
+++ b/browser/devtools/performance/test/browser_timeline_blueprint.js
@@ -1,17 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the timeline blueprint has a correct structure.
*/
-add_task(function*() {
- let { TIMELINE_BLUEPRINT } = devtools.require("devtools/timeline/global");
+function spawnTest () {
+ let { TIMELINE_BLUEPRINT } = devtools.require("devtools/shared/timeline/global");
ok(TIMELINE_BLUEPRINT,
"A timeline blueprint should be available.");
ok(Object.keys(TIMELINE_BLUEPRINT).length,
"The timeline blueprint has at least one entry.");
for (let [key, value] of Iterator(TIMELINE_BLUEPRINT)) {
@@ -19,9 +19,9 @@ add_task(function*() {
"Each entry in the timeline blueprint contains a `group` key.");
ok("fill" in value,
"Each entry in the timeline blueprint contains a `fill` key.");
ok("stroke" in value,
"Each entry in the timeline blueprint contains a `stroke` key.");
ok("label" in value,
"Each entry in the timeline blueprint contains a `label` key.");
}
-});
+}
diff --git a/browser/devtools/profiler/moz.build b/browser/devtools/profiler/moz.build
--- a/browser/devtools/profiler/moz.build
+++ b/browser/devtools/profiler/moz.build
@@ -1,14 +1,11 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_JS_MODULES.devtools.profiler += [
'panel.js',
- 'utils/global.js',
- 'utils/shared.js',
- 'utils/tree-model.js',
- 'utils/tree-view.js'
+ 'utils/shared.js'
]
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
diff --git a/browser/devtools/profiler/profiler.js b/browser/devtools/profiler/profiler.js
--- a/browser/devtools/profiler/profiler.js
+++ b/browser/devtools/profiler/profiler.js
@@ -14,27 +14,27 @@ devtools.lazyRequireGetter(this, "promis
devtools.lazyRequireGetter(this, "EventEmitter",
"devtools/toolkit/event-emitter");
devtools.lazyRequireGetter(this, "DevToolsUtils",
"devtools/toolkit/DevToolsUtils");
devtools.lazyRequireGetter(this, "FramerateFront",
"devtools/server/actors/framerate", true);
devtools.lazyRequireGetter(this, "L10N",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
devtools.lazyRequireGetter(this, "CATEGORIES",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
devtools.lazyRequireGetter(this, "CATEGORY_MAPPINGS",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
devtools.lazyRequireGetter(this, "CATEGORY_OTHER",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
devtools.lazyRequireGetter(this, "ThreadNode",
- "devtools/profiler/tree-model", true);
+ "devtools/shared/profiler/tree-model", true);
devtools.lazyRequireGetter(this, "CallView",
- "devtools/profiler/tree-view", true);
+ "devtools/shared/profiler/tree-view", true);
devtools.lazyImporter(this, "FileUtils",
"resource://gre/modules/FileUtils.jsm");
devtools.lazyImporter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
devtools.lazyImporter(this, "LineGraphWidget",
"resource:///modules/devtools/Graphs.jsm");
devtools.lazyImporter(this, "BarGraphWidget",
diff --git a/browser/devtools/profiler/test/browser.ini b/browser/devtools/profiler/test/browser.ini
--- a/browser/devtools/profiler/test/browser.ini
+++ b/browser/devtools/profiler/test/browser.ini
@@ -1,16 +1,15 @@
[DEFAULT]
subsuite = devtools
support-files =
doc_simple-test.html
head.js
[browser_profiler_aaa_run_first_leaktest.js]
-[browser_profiler_categories.js]
[browser_profiler_console-record-01.js]
skip-if = true # Bug 1047124
[browser_profiler_console-record-02.js]
skip-if = true # Bug 1047124
[browser_profiler_console-record-03.js]
skip-if = true # Bug 1047124
[browser_profiler_console-record-04.js]
skip-if = true # Bug 1047124
@@ -19,17 +18,16 @@ skip-if = true # Bug 1047124
[browser_profiler_console-record-06.js]
skip-if = true # Bug 1047124
[browser_profiler_console-record-07.js]
skip-if = true # Bug 1047124
[browser_profiler_console-record-08.js]
skip-if = true # Bug 1047124
[browser_profiler_console-record-09.js]
skip-if = true # Bug 1047124
-[browser_profiler_content-check.js]
[browser_profiler_data-massaging-01.js]
skip-if = true # Bug 1047124
[browser_profiler_data-massaging-02.js]
skip-if = true # Bug 1047124
[browser_profiler_data-samples.js]
skip-if = true # Bug 1047124
[browser_profiler_gecko-pref-changed.js]
skip-if = true # Bug 1047124
@@ -87,25 +85,8 @@ skip-if = true # Bug 1047124
[browser_profiler_tabbed-browser-02.js]
skip-if = true # Bug 1047124
[browser_profiler_tabbed-browser-03.js]
skip-if = true # Bug 1047124
[browser_profiler_tabbed-browser-add-remove-01.js]
skip-if = true # Bug 1047124
[browser_profiler_tabbed-browser-add-remove-02.js]
skip-if = true # Bug 1047124
-[browser_profiler_tree-abstract-01.js]
-[browser_profiler_tree-abstract-02.js]
-[browser_profiler_tree-abstract-03.js]
-[browser_profiler_tree-abstract-04.js]
-[browser_profiler_tree-frame-node.js]
-[browser_profiler_tree-model-01.js]
-[browser_profiler_tree-model-02.js]
-[browser_profiler_tree-model-03.js]
-[browser_profiler_tree-model-04.js]
-[browser_profiler_tree-model-05.js]
-[browser_profiler_tree-view-01.js]
-[browser_profiler_tree-view-02.js]
-[browser_profiler_tree-view-03.js]
-[browser_profiler_tree-view-04.js]
-[browser_profiler_tree-view-05.js]
-[browser_profiler_tree-view-06.js]
-[browser_profiler_tree-view-07.js]
diff --git a/browser/devtools/shared/moz.build b/browser/devtools/shared/moz.build
--- a/browser/devtools/shared/moz.build
+++ b/browser/devtools/shared/moz.build
@@ -26,16 +26,30 @@ EXTRA_JS_MODULES.devtools += [
'widgets/GraphsWorker.js',
'widgets/SideMenuWidget.jsm',
'widgets/SimpleListWidget.jsm',
'widgets/VariablesView.jsm',
'widgets/VariablesViewController.jsm',
'widgets/ViewHelpers.jsm',
]
+EXTRA_JS_MODULES.devtools.shared.profiler += [
+ 'profiler/global.js',
+ 'profiler/tree-model.js',
+ 'profiler/tree-view.js',
+]
+
+EXTRA_JS_MODULES.devtools.shared.timeline += [
+ 'timeline/global.js',
+ 'timeline/marker-details.js',
+ 'timeline/markers-overview.js',
+ 'timeline/memory-overview.js',
+ 'timeline/waterfall.js',
+]
+
EXTRA_JS_MODULES.devtools.shared += [
'autocomplete-popup.js',
'd3.js',
'doorhanger.js',
'frame-script-utils.js',
'inplace-editor.js',
'observable-object.js',
'options-view.js',
diff --git a/browser/devtools/profiler/utils/global.js b/browser/devtools/shared/profiler/global.js
rename from browser/devtools/profiler/utils/global.js
rename to browser/devtools/shared/profiler/global.js
diff --git a/browser/devtools/profiler/utils/tree-model.js b/browser/devtools/shared/profiler/tree-model.js
rename from browser/devtools/profiler/utils/tree-model.js
rename to browser/devtools/shared/profiler/tree-model.js
--- a/browser/devtools/profiler/utils/tree-model.js
+++ b/browser/devtools/shared/profiler/tree-model.js
@@ -2,21 +2,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {Cc, Ci, Cu, Cr} = require("chrome");
loader.lazyRequireGetter(this, "Services");
loader.lazyRequireGetter(this, "L10N",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
loader.lazyRequireGetter(this, "CATEGORY_MAPPINGS",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
loader.lazyRequireGetter(this, "CATEGORY_JIT",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
const CHROME_SCHEMES = ["chrome://", "resource://"];
const CONTENT_SCHEMES = ["http://", "https://", "file://"];
exports.ThreadNode = ThreadNode;
exports.FrameNode = FrameNode;
exports.FrameNode.isContent = isContent;
diff --git a/browser/devtools/profiler/utils/tree-view.js b/browser/devtools/shared/profiler/tree-view.js
rename from browser/devtools/profiler/utils/tree-view.js
rename to browser/devtools/shared/profiler/tree-view.js
--- a/browser/devtools/profiler/utils/tree-view.js
+++ b/browser/devtools/shared/profiler/tree-view.js
@@ -1,17 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {Cc, Ci, Cu, Cr} = require("chrome");
loader.lazyRequireGetter(this, "L10N",
- "devtools/profiler/global", true);
+ "devtools/shared/profiler/global", true);
loader.lazyImporter(this, "Heritage",
"resource:///modules/devtools/ViewHelpers.jsm");
loader.lazyImporter(this, "AbstractTreeItem",
"resource:///modules/devtools/AbstractTreeItem.jsm");
const MILLISECOND_UNITS = L10N.getStr("table.ms");
const PERCENTAGE_UNITS = L10N.getStr("table.percentage");
diff --git a/browser/devtools/shared/test/browser_flame-graph-utils-03.js b/browser/devtools/shared/test/browser_flame-graph-utils-03.js
--- a/browser/devtools/shared/test/browser_flame-graph-utils-03.js
+++ b/browser/devtools/shared/test/browser_flame-graph-utils-03.js
@@ -1,15 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests if platform frames are removed from the flame graph data.
let {FlameGraphUtils} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
-let {FrameNode} = devtools.require("devtools/profiler/tree-model");
+let {FrameNode} = devtools.require("devtools/shared/profiler/tree-model");
add_task(function*() {
yield promiseTab("about:blank");
yield performTest();
gBrowser.removeCurrentTab();
});
function* performTest() {
diff --git a/browser/devtools/shared/test/browser_flame-graph-utils-04.js b/browser/devtools/shared/test/browser_flame-graph-utils-04.js
--- a/browser/devtools/shared/test/browser_flame-graph-utils-04.js
+++ b/browser/devtools/shared/test/browser_flame-graph-utils-04.js
@@ -1,15 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests if (idle) nodes are added when necessary in the flame graph data.
let {FlameGraphUtils} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
-let {FrameNode} = devtools.require("devtools/profiler/tree-model");
+let {FrameNode} = devtools.require("devtools/shared/profiler/tree-model");
add_task(function*() {
yield promiseTab("about:blank");
yield performTest();
gBrowser.removeCurrentTab();
});
function* performTest() {
diff --git a/browser/devtools/timeline/widgets/global.js b/browser/devtools/shared/timeline/global.js
rename from browser/devtools/timeline/widgets/global.js
rename to browser/devtools/shared/timeline/global.js
diff --git a/browser/devtools/timeline/widgets/marker-details.js b/browser/devtools/shared/timeline/marker-details.js
rename from browser/devtools/timeline/widgets/marker-details.js
rename to browser/devtools/shared/timeline/marker-details.js
--- a/browser/devtools/timeline/widgets/marker-details.js
+++ b/browser/devtools/shared/timeline/marker-details.js
@@ -6,19 +6,19 @@
let { Ci } = require("chrome");
let WebConsoleUtils = require("devtools/toolkit/webconsole/utils").Utils;
/**