OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 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/core/test_utils.html"> | 8 <link rel="import" href="/tracing/core/test_utils.html"> |
9 <link rel="import" href="/tracing/model/event_set.html"> | 9 <link rel="import" href="/tracing/model/event_set.html"> |
10 <link rel="import" href="/tracing/model/model.html"> | 10 <link rel="import" href="/tracing/model/model.html"> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 }); | 79 }); |
80 | 80 |
81 test('instantiate_twoTabs', function() { | 81 test('instantiate_twoTabs', function() { |
82 var tabView = document.createElement('tr-ui-a-tab-view'); | 82 var tabView = document.createElement('tr-ui-a-tab-view'); |
83 tabView.label = '3 items selected.'; | 83 tabView.label = '3 items selected.'; |
84 tabView.addSubView(createPowerSampleSubView()); | 84 tabView.addSubView(createPowerSampleSubView()); |
85 tabView.addSubView(createAlertSubView()); | 85 tabView.addSubView(createAlertSubView()); |
86 this.addHTMLOutput(tabView); | 86 this.addHTMLOutput(tabView); |
87 }); | 87 }); |
88 | 88 |
89 test('addSubView_throwsWithNonHtmlElement', function() { | |
90 var tabView = document.createElement('tr-ui-a-tab-view'); | |
91 | |
92 assert.throws(function() { | |
93 tabView.addSubView(1); | |
94 }, 'Sub-view being added must be a registered Polymer element with the ' + | |
95 'sub-view behavior'); | |
96 }); | |
97 | |
98 test('addSubView_throwsWithNonPolymerHtmlElement', function() { | |
99 var tabView = document.createElement('tr-ui-a-tab-view'); | |
100 | |
101 assert.throws(function() { | |
102 tabView.addSubView(document.createElement('p')); | |
103 }, 'Sub-view being added must be a registered Polymer element with the ' + | |
104 'sub-view behavior'); | |
105 }); | |
106 | |
107 test('addSubView_throwsWithNonAnalysisViewPolymerElement', function() { | |
108 var tabView = document.createElement('tr-ui-a-tab-view'); | |
109 | |
110 assert.throws(function() { | |
111 tabView.addSubView( | |
112 document.createElement('tr-ui-b-tab-view-test-non-sub-view')); | |
113 }, 'Sub-view being added must be a registered Polymer element with the ' + | |
114 'sub-view behavior'); | |
115 }); | |
116 | |
117 test('clearSubViews_selectedSubViewNullAfter', function() { | 89 test('clearSubViews_selectedSubViewNullAfter', function() { |
118 var tabView = document.createElement('tr-ui-a-tab-view'); | 90 var tabView = document.createElement('tr-ui-a-tab-view'); |
119 tabView.label = '3 items selected.'; | 91 tabView.label = '3 items selected.'; |
120 tabView.addSubView(createPowerSampleSubView()); | 92 tabView.addSubView(createPowerSampleSubView()); |
121 tabView.addSubView(createAlertSubView()); | 93 tabView.addSubView(createAlertSubView()); |
122 | 94 |
123 tabView.clearSubViews(); | 95 tabView.clearSubViews(); |
124 | 96 |
125 assert.isUndefined(tabView.selectedSubView); | 97 assert.isUndefined(tabView.selectedSubView); |
126 }); | 98 }); |
127 }); | 99 }); |
128 </script> | 100 </script> |
OLD | NEW |