| 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.showPanel("profiles"); | 5 WebInspector.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 27 matching lines...) Expand all Loading... |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 InspectorTest.showProfileWhenAdded = function(title) | 40 InspectorTest.showProfileWhenAdded = function(title) |
| 41 { | 41 { |
| 42 InspectorTest._showProfileWhenAdded = title; | 42 InspectorTest._showProfileWhenAdded = title; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 InspectorTest._profileHeaderAdded = function(profile) | 45 InspectorTest._profileHeaderAdded = function(profile) |
| 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.profile.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.profile.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 |