Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Side by Side Diff: LayoutTests/inspector/timeline/timeline-load.html

Issue 709423002: DevTools: remove old Timeline front-end implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated LayoutTests/inspector/layers/layer-canvas-log.html Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script>
6
7 function test()
8 {
9 function runTestWithDataAndCheck(input, expectedOutput)
10 {
11 var model = new WebInspector.TimelineModelImpl(WebInspector.timelineMana ger);
12
13 function createFileReader(file, delegate)
14 {
15 return new InspectorTest.FakeFileReader(input, delegate, model.saveT oFile.bind(model));
16 }
17
18 function createFileWriter()
19 {
20 return new InspectorTest.StringOutputStream(checkSaveData);
21 }
22
23 function checkSaveData(output)
24 {
25 var saveData = JSON.parse(output);
26 saveData.shift(); // strip version info
27 expectedOutput.shift();
28 InspectorTest.assertEquals(JSON.stringify(expectedOutput), JSON.stri ngify(saveData), "saved data is not equal to restored");
29 InspectorTest.addResult("passed");
30 }
31
32 InspectorTest.override(model, "_createFileReader", createFileReader);
33 InspectorTest.override(model, "_createFileWriter", createFileWriter);
34
35 model.loadFromFile({}, new WebInspector.Progress());
36 }
37
38 InspectorTest.runTestSuite([
39 function testNormal(next)
40 {
41 var data = ["Version",
42 {"startTime":1310749854316.8408,"data":{"requestId":43,"url":"ht tp://www.webkit.org/","requestMethod":"GET"},"type":"ResourceSendRequest"},
43 {"startTime":1310749855118.9329,"data":{"requestId":43,"statusCo de":200,"mimeType":"text/html"},"children":[],"endTime":1310749855118.968,"type" :"ResourceReceiveResponse"},
44 {"startTime":1310749855136.245,"data":{"requestId":44,"url":"htt p://www.webkit.org/css/main.css","requestMethod":"GET"},"type":"ResourceSendRequ est"},
45 {"startTime":1310749855136.655,"data":{"requestId":45,"url":"htt p://www.webkit.org/css/green.css","requestMethod":"GET"},"type":"ResourceSendReq uest"},
46 {"startTime":1310749855137.023,"data":{"requestId":46,"url":"htt p://www.webkit.org/css/blue.css","requestMethod":"GET"},"type":"ResourceSendRequ est"},
47 {"startTime":1310749855137.342,"data":{"requestId":47,"url":"htt p://www.webkit.org/css/yellow.css","requestMethod":"GET"},"type":"ResourceSendRe quest"},
48 {"startTime":1310749855137.656,"data":{"requestId":48,"url":"htt p://www.webkit.org/css/pink.css","requestMethod":"GET"},"type":"ResourceSendRequ est"},
49 {"startTime":1310749855137.989,"data":{"requestId":49,"url":"htt p://www.webkit.org/css/purple.css","requestMethod":"GET"},"type":"ResourceSendRe quest"},
50 {"startTime":1310749855138.308,"data":{"requestId":50,"url":"htt p://www.webkit.org/css/gray.css","requestMethod":"GET"},"type":"ResourceSendRequ est"}
51 ];
52 var input = JSON.stringify(data);
53 runTestWithDataAndCheck(input, data);
54 next();
55 },
56
57 function testIncompatible(next)
58 {
59 var data = ["Version",
60 {"startTime":1310749854316.8408,"data":{"requestId":43,"url":"ht tp://www.webkit.org/","requestMethod":"GET"},"t\"y}p}e\\":"UnknownRecordType"}
61 ];
62 var input = JSON.stringify(data);
63 runTestWithDataAndCheck(input, data);
64 next();
65 },
66
67 function testMalformed(next)
68 {
69 var data = ["Version"];
70 // At least 1 record is parsed in first chunk.
71 var input = '["Version",'
72 +'{"startTime":1310749854316.8408,"data":{"requestId":43},"type" :"UnknownRecordType"},'
73 +'{"startTime":1310749854316.8508,"data":{"requestId":43},"type" :"UnknownRecordType"},'
74 +'{"startTime":1310749854316.8608,"data":{"requestId":43},"type" :"UnknownRecordType"},'
75 +'{"startTime":1310749854316.8708,"data":{"requestId":43_MALFORM ED_JSON_},"type":"UnknownRecordType"}]';
76 runTestWithDataAndCheck(input, data);
77 next();
78 }
79 ]);
80 }
81
82 </script>
83 </head>
84
85 <body onload="runTest()">
86 <p>
87 Tests the Timeline save/load functionality.
88 </p>
89
90 <p>
91 Also tests save/load of unknown (incompatible) record types. <a href="https://bu gs.webkit.org/show_bug.cgi?id=91714">(Bug 91714)</a>
92 </p>
93
94 </body>
95 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698