| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/tracing/base/quad.html"> | 8 <link rel="import" href="/tracing/base/math/quad.html"> |
| 9 <link rel="import" href="/tracing/base/rect.html"> | 9 <link rel="import" href="/tracing/base/math/rect.html"> |
| 10 <link rel="import" href="/tracing/extras/chrome/cc/util.html"> | 10 <link rel="import" href="/tracing/extras/chrome/cc/util.html"> |
| 11 | 11 |
| 12 <script> | 12 <script> |
| 13 | 13 |
| 14 'use strict'; | 14 'use strict'; |
| 15 | 15 |
| 16 tr.b.unittest.testSuite(function() { | 16 tr.b.unittest.testSuite(function() { |
| 17 test('nameConvert', function() { | 17 test('nameConvert', function() { |
| 18 assert.equal(tr.e.cc.convertNameToJSConvention('_foo'), '_foo'); | 18 assert.equal(tr.e.cc.convertNameToJSConvention('_foo'), '_foo'); |
| 19 assert.equal(tr.e.cc.convertNameToJSConvention('foo_'), 'foo_'); | 19 assert.equal(tr.e.cc.convertNameToJSConvention('foo_'), 'foo_'); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 assert.deepEqual(object, expected); | 63 assert.deepEqual(object, expected); |
| 64 }); | 64 }); |
| 65 | 65 |
| 66 test('quadCoversion', function() { | 66 test('quadCoversion', function() { |
| 67 var object = { | 67 var object = { |
| 68 args: { | 68 args: { |
| 69 some_quad: [1, 2, 3, 4, 5, 6, 7, 8] | 69 some_quad: [1, 2, 3, 4, 5, 6, 7, 8] |
| 70 } | 70 } |
| 71 }; | 71 }; |
| 72 tr.e.cc.preInitializeObject(object); | 72 tr.e.cc.preInitializeObject(object); |
| 73 assert.instanceOf(object.args.someQuad, tr.b.Quad); | 73 assert.instanceOf(object.args.someQuad, tr.b.math.Quad); |
| 74 }); | 74 }); |
| 75 | 75 |
| 76 test('quadConversionNested', function() { | 76 test('quadConversionNested', function() { |
| 77 var object = { | 77 var object = { |
| 78 args: { | 78 args: { |
| 79 nested_field: { | 79 nested_field: { |
| 80 a_quad: [1, 2, 3, 4, 5, 6, 7, 8] | 80 a_quad: [1, 2, 3, 4, 5, 6, 7, 8] |
| 81 }, | 81 }, |
| 82 non_nested_quad: [1, 2, 3, 4, 5, 6, 7, 8] | 82 non_nested_quad: [1, 2, 3, 4, 5, 6, 7, 8] |
| 83 } | 83 } |
| 84 }; | 84 }; |
| 85 tr.e.cc.preInitializeObject(object); | 85 tr.e.cc.preInitializeObject(object); |
| 86 assert.instanceOf(object.args.nestedField.aQuad, tr.b.Quad); | 86 assert.instanceOf(object.args.nestedField.aQuad, tr.b.math.Quad); |
| 87 assert.instanceOf(object.args.nonNestedQuad, tr.b.Quad); | 87 assert.instanceOf(object.args.nonNestedQuad, tr.b.math.Quad); |
| 88 }); | 88 }); |
| 89 | 89 |
| 90 test('rectCoversion', function() { | 90 test('rectCoversion', function() { |
| 91 var object = { | 91 var object = { |
| 92 args: { | 92 args: { |
| 93 some_rect: [1, 2, 3, 4] | 93 some_rect: [1, 2, 3, 4] |
| 94 } | 94 } |
| 95 }; | 95 }; |
| 96 tr.e.cc.preInitializeObject(object); | 96 tr.e.cc.preInitializeObject(object); |
| 97 assert.instanceOf(object.args.someRect, tr.b.Rect); | 97 assert.instanceOf(object.args.someRect, tr.b.math.Rect); |
| 98 }); | 98 }); |
| 99 | 99 |
| 100 test('rectCoversionNested', function() { | 100 test('rectCoversionNested', function() { |
| 101 var object = { | 101 var object = { |
| 102 args: { | 102 args: { |
| 103 nested_field: { | 103 nested_field: { |
| 104 a_rect: [1, 2, 3, 4] | 104 a_rect: [1, 2, 3, 4] |
| 105 }, | 105 }, |
| 106 non_nested_rect: [1, 2, 3, 4] | 106 non_nested_rect: [1, 2, 3, 4] |
| 107 } | 107 } |
| 108 }; | 108 }; |
| 109 tr.e.cc.preInitializeObject(object); | 109 tr.e.cc.preInitializeObject(object); |
| 110 assert.instanceOf(object.args.nestedField.aRect, tr.b.Rect); | 110 assert.instanceOf(object.args.nestedField.aRect, tr.b.math.Rect); |
| 111 assert.instanceOf(object.args.nonNestedRect, tr.b.Rect); | 111 assert.instanceOf(object.args.nonNestedRect, tr.b.math.Rect); |
| 112 }); | 112 }); |
| 113 }); | 113 }); |
| 114 </script> | 114 </script> |
| OLD | NEW |