| Index: tracing/tracing/model/thread_test.html
|
| diff --git a/tracing/tracing/model/thread_test.html b/tracing/tracing/model/thread_test.html
|
| index 55cbb346ef89998b8143e88f2c95908e7a10ca0c..8d5144f705f76816b84b7d5c274fb7aba517302b 100644
|
| --- a/tracing/tracing/model/thread_test.html
|
| +++ b/tracing/tracing/model/thread_test.html
|
| @@ -180,6 +180,42 @@ tr.b.unittest.testSuite(function() {
|
| });
|
| });
|
| });
|
| +
|
| + test('typeGetterReturnsCorrectType', function() {
|
| + const model = tr.c.TestUtils.newModel(function(model) {
|
| + const process = model.getOrCreateProcess(1);
|
| + const thread1 = process.getOrCreateThread(1);
|
| + const thread2 = process.getOrCreateThread(2);
|
| + const thread3 = process.getOrCreateThread(3);
|
| + const thread4 = process.getOrCreateThread(4);
|
| +
|
| + thread1.name = 'ThreadName12';
|
| + thread2.name = 'ThreadName/34123';
|
| + thread3.name = 'ThreadName1/34123';
|
| + thread4.name = 'ThreadName';
|
| +
|
| + for (const thread of [thread1, thread2, thread3, thread4]) {
|
| + assert.equal(thread.type, 'ThreadName');
|
| + }
|
| + });
|
| + });
|
| +
|
| + test('typeGetterThrowsIfThreadNameStartsWithNumberOrSlash', function() {
|
| + const model = tr.c.TestUtils.newModel(function(model) {
|
| + const process = model.getOrCreateProcess(1);
|
| + const thread1 = process.getOrCreateThread(1);
|
| + const thread2 = process.getOrCreateThread(2);
|
| + const thread3 = process.getOrCreateThread(3);
|
| +
|
| + thread1.name = '123';
|
| + thread2.name = '42GPU';
|
| + thread3.name = '/123';
|
| +
|
| + for (const thread of [thread1, thread2, thread3]) {
|
| + assert.throws(() => thread.type);
|
| + }
|
| + });
|
| + });
|
| });
|
| </script>
|
|
|
|
|