OLD | NEW |
1 var initialize_ProfilerTest = function() { | 1 var initialize_ProfilerTest = function() { |
2 | 2 |
3 InspectorTest.startProfilerTest = function(callback) | 3 InspectorTest.startProfilerTest = function(callback) |
4 { | 4 { |
5 WebInspector.inspectorView.showPanel("profiles"); | 5 WebInspector.inspectorView.showPanel("profiles"); |
6 | 6 |
7 InspectorTest.addResult("Profiler was enabled."); | 7 InspectorTest.addResult("Profiler was enabled."); |
8 InspectorTest.addSniffer(WebInspector.panels.profiles, "_addProfileHeader",
InspectorTest._profileHeaderAdded, true); | 8 InspectorTest.addSniffer(WebInspector.panels.profiles, "_addProfileHeader",
InspectorTest._profileHeaderAdded, true); |
9 InspectorTest.addSniffer(WebInspector.CPUProfileView.prototype, "refresh", I
nspectorTest._profileViewRefresh, true); | 9 InspectorTest.addSniffer(WebInspector.CPUProfileView.prototype, "refresh", I
nspectorTest._profileViewRefresh, true); |
10 InspectorTest.safeWrap(callback)(); | 10 InspectorTest.safeWrap(callback)(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 { | 46 { |
47 if (InspectorTest._showProfileWhenAdded === profile.title) | 47 if (InspectorTest._showProfileWhenAdded === profile.title) |
48 WebInspector.panels.profiles.showProfile(profile); | 48 WebInspector.panels.profiles.showProfile(profile); |
49 }; | 49 }; |
50 | 50 |
51 InspectorTest.waitUntilProfileViewIsShown = function(title, callback) | 51 InspectorTest.waitUntilProfileViewIsShown = function(title, callback) |
52 { | 52 { |
53 callback = InspectorTest.safeWrap(callback); | 53 callback = InspectorTest.safeWrap(callback); |
54 | 54 |
55 var profilesPanel = WebInspector.panels.profiles; | 55 var profilesPanel = WebInspector.panels.profiles; |
56 if (profilesPanel.visibleView && profilesPanel.visibleView.profile && profil
esPanel.visibleView.profile.title === title) | 56 if (profilesPanel.visibleView && profilesPanel.visibleView.profile && profil
esPanel.visibleView._profileHeader.title === title) |
57 callback(profilesPanel.visibleView); | 57 callback(profilesPanel.visibleView); |
58 else | 58 else |
59 InspectorTest._waitUntilProfileViewIsShownCallback = { title: title, cal
lback: callback }; | 59 InspectorTest._waitUntilProfileViewIsShownCallback = { title: title, cal
lback: callback }; |
60 } | 60 } |
61 | 61 |
62 InspectorTest._profileViewRefresh = function() | 62 InspectorTest._profileViewRefresh = function() |
63 { | 63 { |
64 // Called in the context of ProfileView. | 64 // Called in the context of ProfileView. |
65 if (InspectorTest._waitUntilProfileViewIsShownCallback && InspectorTest._wai
tUntilProfileViewIsShownCallback.title === this.profile.title) { | 65 if (InspectorTest._waitUntilProfileViewIsShownCallback && InspectorTest._wai
tUntilProfileViewIsShownCallback.title === this._profileHeader.title) { |
66 var callback = InspectorTest._waitUntilProfileViewIsShownCallback; | 66 var callback = InspectorTest._waitUntilProfileViewIsShownCallback; |
67 delete InspectorTest._waitUntilProfileViewIsShownCallback; | 67 delete InspectorTest._waitUntilProfileViewIsShownCallback; |
68 callback.callback(this); | 68 callback.callback(this); |
69 } | 69 } |
70 }; | 70 }; |
71 | 71 |
72 }; | 72 }; |
OLD | NEW |