OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="profiler-test.js"></script> | 4 <script src="profiler-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function pageFunction() { | 7 function pageFunction() { |
8 console.profile("manual"); | 8 console.profile("manual"); |
9 console.profileEnd("manual"); | 9 console.profileEnd("manual"); |
10 } | 10 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (loadedProfileData === file._data()) | 92 if (loadedProfileData === file._data()) |
93 InspectorTest.addResult("PASS: the content of loaded profile
matches with the original profile."); | 93 InspectorTest.addResult("PASS: the content of loaded profile
matches with the original profile."); |
94 else { | 94 else { |
95 InspectorTest.addResult("FAIL: the content of loaded profile
doesn't match with the original profile."); | 95 InspectorTest.addResult("FAIL: the content of loaded profile
doesn't match with the original profile."); |
96 InspectorTest.addResult("old: " + file._data()); | 96 InspectorTest.addResult("old: " + file._data()); |
97 InspectorTest.addResult("new: " + loadedProfileData); | 97 InspectorTest.addResult("new: " + loadedProfileData); |
98 } | 98 } |
99 next(); | 99 next(); |
100 } | 100 } |
101 var profilesPanel = WebInspector.panels.profiles; | 101 var profilesPanel = WebInspector.panels.profiles; |
102 InspectorTest.waitUntilProfileViewIsShown(file.name, checkLoadedCont
ent); | 102 var profileName = file.name.substr(0, file.name.length - ".cpuprofil
e".length); |
| 103 InspectorTest.waitUntilProfileViewIsShown(profileName, checkLoadedCo
ntent); |
103 profilesPanel._loadFromFile(file); | 104 profilesPanel._loadFromFile(file); |
104 var onTransferFinished = WebInspector.CPUProfileHeader.prototype.onT
ransferFinished; | 105 var onTransferFinished = WebInspector.CPUProfileHeader.prototype.onT
ransferFinished; |
105 WebInspector.CPUProfileHeader.prototype.onTransferFinished = functio
n() | 106 WebInspector.CPUProfileHeader.prototype.onTransferFinished = functio
n() |
106 { | 107 { |
107 loadedProfileData = this._jsonifiedProfile; | 108 loadedProfileData = this._jsonifiedProfile; |
108 onTransferFinished.call(this); | 109 onTransferFinished.call(this); |
109 WebInspector.panels.profiles._showProfile(this); | 110 WebInspector.panels.profiles._showProfile(this); |
110 } | 111 } |
111 } | 112 } |
112 | 113 |
113 ]); | 114 ]); |
114 } | 115 } |
115 | 116 |
116 </script> | 117 </script> |
117 </head> | 118 </head> |
118 <body onload="runTest()"> | 119 <body onload="runTest()"> |
119 <p> | 120 <p> |
120 Tests that CPU profiling is able to save/load. | 121 Tests that CPU profiling is able to save/load. |
121 | 122 |
122 </p> | 123 </p> |
123 </body> | 124 </body> |
124 </html> | 125 </html> |
OLD | NEW |