3 <script src=
"../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"tracing-test.js"></script>
12 {"name": "NonAscii", "ts": 10000, args
: {"nonascii": "лет ми спик фром май харт"}, "dur": 1000, "ph": "X", "tid": mainThread
, "pid": 100, "cat":"test"},
13 {"name": "NonAsciiSnapshot", "ts": 20000, args
: {"snapshot": "тест"}, "dur": 1000, "ph": "O", "tid": mainThread
, "pid": 100, "cat":"test"},
14 {"name": "ShortSnapshot", "ts": 20000, args
: {"snapshot": "short snapshot data"}, "dur": 1000, "ph": "O", "tid": mainThread
, "pid": 100, "cat":"test"},
15 {"name": "LongSnapshot", "ts": 20000, args
: {"snapshot": "abcdef".repeat(10000)}, "dur": 1000, "ph": "O", "tid": mainThread
, "pid": 100, "cat":"test"}
18 function getEventByName(name
)
20 return thread
.events().filter(function(event
) { return event
.name
=== name
; })[0];
23 var model
= InspectorTest
.createTracingModel();
24 model
.setEventsForTest(testData
);
25 var process
= model
.sortedProcesses()[0];
26 var thread
= process
.sortedThreads()[0];
27 InspectorTest
.assertEquals("лет ми спик фром май харт", getEventByName("NonAscii").args
["nonascii"]);
28 getEventByName("ShortSnapshot").requestObject(step1
);
29 function step1(object
)
31 InspectorTest
.assertEquals("short snapshot data", object
);
32 getEventByName("LongSnapshot").requestObject(step2
);
34 function step2(object
)
36 InspectorTest
.assertEquals("abcdef".repeat(10000), object
);
37 getEventByName("NonAsciiSnapshot").requestObject(step3
);
39 function step3(object
)
41 InspectorTest
.assertEquals("тест", object
);
42 InspectorTest
.addResult("DONE");
43 InspectorTest
.completeTest();
49 <body onload=
"runTest()">
50 <p>Test that tracing model correctly processes trace events.