Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2017 The Chromium Authors. All rights reserved. | 3 Copyright 2017 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="/dashboard/elements/speed-releasing-table.html"> | 8 <link rel="import" href="/dashboard/elements/speed-releasing-table.html"> |
| 9 <link rel="import" href="/dashboard/static/simple_xhr.html"> | 9 <link rel="import" href="/dashboard/static/simple_xhr.html"> |
| 10 <link rel="import" href="/dashboard/static/testing_common.html"> | 10 <link rel="import" href="/dashboard/static/testing_common.html"> |
| 11 | 11 |
| 12 <link rel="import" href="/tracing/base/unit.html"> | 12 <link rel="import" href="/tracing/base/unit.html"> |
| 13 <link rel="import" href="/tracing/core/test_utils.html"> | 13 <link rel="import" href="/tracing/core/test_utils.html"> |
| 14 | 14 |
| 15 <script> | 15 <script> |
| 16 'use strict'; | 16 'use strict'; |
| 17 | 17 |
| 18 tr.b.unittest.testSuite(function() { | 18 tr.b.unittest.testSuite(function() { |
| 19 | 19 |
| 20 var testOptions = { | 20 var testOptions = { |
| 21 tearDown: function() { | 21 tearDown: function() { |
| 22 testing_common.clearXhrMock(); | 22 testing_common.clearXhrMock(); |
| 23 } | 23 } |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 var testData = { | |
| 27 '123': | |
| 28 { | |
|
eakuefner
2017/01/28 00:22:17
why are there so many spaces here? these should be
jessimb
2017/01/30 19:23:10
Fixed.
| |
| 29 'master/bot': { | |
| 30 'test/test': 10001, | |
| 31 'test/test1': 50001, | |
| 32 'test2/test3': 20001, | |
| 33 'test2/test4': 40002, | |
| 34 'test2/test5': 40002, | |
| 35 }, | |
| 36 | |
| 37 | |
| 38 'master2/bot2': { | |
| 39 'test/test': 30001, | |
| 40 'test/test1': 60001, | |
| 41 'test2/test3': 40001, | |
| 42 'test2/test4': 40002, | |
| 43 'test2/test5': 40002, | |
| 44 } | |
| 45 }, | |
| 46 | |
| 47 '456': | |
| 48 { | |
| 49 'master/bot': { | |
| 50 'test/test': 10002, | |
| 51 'test/test1': 50402, | |
| 52 'test2/test3': 20002, | |
| 53 'test2/test4': 40002, | |
| 54 'test2/test5': 40002, | |
| 55 }, | |
| 56 | |
| 57 | |
| 58 'master2/bot2': { | |
| 59 'test/test': 30012, | |
| 60 'test/test1': 60222, | |
| 61 'test2/test3': 40007, | |
| 62 'test2/test4': 40052, | |
| 63 'test2/test5': 40012, | |
| 64 } | |
| 65 } | |
| 66 , | |
| 67 }; | |
| 68 | |
| 69 var testLayout = { | |
| 70 'test/test': ['foreground', 'Pretty Name'], | |
| 71 'test/test1': ['foreground', 'Prettier Name'], | |
| 72 'test2/test3': ['foreground', 'Prettiester Name'], | |
| 73 'test2/test4': ['background', 'Prettiestest Name'], | |
| 74 'test2/test5': ['background', 'Prettiestestest Name'], | |
| 75 }; | |
| 76 | |
| 77 var unitMap = { | |
| 78 'test/test': 'timeStampInMs', | |
| 79 'test/test1': 'sizeInBytes', | |
| 80 'test2/test3': 'powerInWatts', | |
| 81 'test2/test4': 'count', | |
| 82 'test2/test5': 'sizeInBytes', | |
| 83 }; | |
| 84 | |
| 85 var categories = { | |
| 86 'foreground': 3, | |
| 87 'background': 2 | |
| 88 }; | |
| 89 | |
| 90 var revisions = [123, 456]; | |
| 91 | |
| 26 test('instantiation', function() { | 92 test('instantiation', function() { |
| 27 var mockResponse = { | 93 var mockResponse = { |
| 28 'table_bots': ['master/bot', 'master2/bot2'], | 94 'table_bots': ['master/bot', 'master2/bot2'], |
| 29 'table_tests': ['test/test', 'test2/test3'], | 95 'table_tests': ['test/test', 'test/test1', 'test2/test3', |
| 30 'table_layout': '{\'this will\': \'get changed later\'}', | 96 'test2/test4', 'test2/test5'], |
| 97 'table_layout': testLayout, | |
| 31 'name': 'fakeTable', | 98 'name': 'fakeTable', |
| 99 'values': testData, | |
| 100 'units': unitMap, | |
| 101 'revisions': revisions, | |
| 102 'categories': categories, | |
| 32 }; | 103 }; |
| 33 testing_common.addXhrMock('/speed_releasing/undefined?=', | 104 testing_common.addXhrMock('/speed_releasing/undefined?=', |
| 34 JSON.stringify(mockResponse)); | 105 JSON.stringify(mockResponse)); |
| 35 var table = document.createElement('speed-releasing-table'); | 106 var table = document.createElement('speed-releasing-table'); |
| 36 this.addHTMLOutput(table); | 107 this.addHTMLOutput(table); |
| 37 }, testOptions); | 108 }, testOptions); |
| 38 | 109 |
| 39 | 110 |
| 40 }); | 111 }); |
| 41 </script> | 112 </script> |
| OLD | NEW |