Changeset 93758 in webkit
- Timestamp:
- Aug 24, 2011 8:35:43 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js
r93738 r93758 35 35 36 36 this._view.setTestList(Object.keys(this._resultsByTest)); 37 38 this._view.addAction(new ui.actions.Rebaseline().makeDefault()); 39 this._view.addAction(new ui.actions.Previous()); 40 this._view.addAction(new ui.actions.Next()); 41 this._view.addAction(new ui.actions.Close()); 42 37 43 $(this._view).bind('testselected', this.onTestSelected.bind(this)); 38 44 $(this._view).bind('builderselected', this.onBuilderSelected.bind(this)); 39 45 $(this._view).bind('rebaseline', this.onRebaseline.bind(this)); 40 // FIXME: Bind the next/previous events.46 $(this._view).bind('close', this.onClose.bind(this)); 41 47 }, 42 48 _failureInfoForTestAndBuilder: function(testName, builderName) … … 58 64 this._view.showResults(this._failureInfoForTestAndBuilder(testName, builderNameList[0])); 59 65 }, 60 onTestSelected: function( event, testName)66 onTestSelected: function() 61 67 { 62 this.showTest(t estName)68 this.showTest(this._view.currentTestName()); 63 69 }, 64 70 onBuilderSelected: function() { 65 this._view.showResults(this._failureInfoForTestAndBuilder(this._view.currentTestName(), this._view.currentBuilderName())); 71 this._view.showResults(this._failureInfoForTestAndBuilder(this._view.currentTestName(), 72 this._view.currentBuilderName())); 66 73 }, 67 74 onRebaseline: function() { … … 72 79 'builderName': builderName 73 80 }); 81 }, 82 onClose: function() { 83 this.dismiss(); 74 84 } 75 85 }); -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions.js
r93738 r93758 64 64 }); 65 65 66 ui.actions.Close = base.extends(Action, { 67 init: function() { 68 this.textContent = 'Close'; 69 this._eventName = 'close'; 70 } 71 }); 72 66 73 ui.actions.Next = base.extends(Action, { 67 74 init: function() { … … 83 90 init: function(actions) { 84 91 this.className = 'actions'; 85 $(this).append(actions.map(function(action) { 86 var item = document.createElement('li'); 87 item.appendChild(action); 88 return item; 89 })); 92 if (!actions) 93 return; 94 actions.forEach(this.add.bind(this)); 95 }, 96 add: function(action) 97 { 98 var item = document.createElement('li'); 99 item.appendChild(action); 100 $(this).append(item); 90 101 } 91 102 }); -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions_unittests.js
r93738 r93758 70 70 equal(list.innerHTML, 71 71 '<li><button>Rebaseline</button></li>' + 72 '<li><button class="previous"> ◀</button></li>' +73 '<li><button class="next"> ▶</button></li>');72 '<li><button class="previous">\u25C0</button></li>' + 73 '<li><button class="next">\u25B6</button></li>'); 74 74 }); 75 75 -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js
r93483 r93758 152 152 }); 153 153 154 ui.results.TestSelector = base.extends('input', { 155 init: function() 156 { 157 this.className = 'test-selector'; 158 this.type = 'text'; 159 this.placeholder = 'Test name'; 160 }, 161 setTestList: function(testNameList) 162 { 163 $(this).autocomplete({ 164 source: testNameList, 165 select: function(event, selected) { 166 $(this).trigger('testselected', [selected.item.value]); 167 }.bind(this) 168 }); 169 } 170 }); 171 172 ui.results.BuilderSelector = base.extends('select', { 173 init: function() 174 { 175 this.className = 'builder-selector'; 176 $(this).hide(); 154 var Selector = base.extends('select', { 155 init: function() 156 { 157 this._eventName = null; 177 158 $(this).change(function() { 178 $(this).trigger('builderselected'); 179 }.bind(this)); 180 }, 181 show: function(builderNameList) { 159 if (this._eventName) 160 $(this).trigger(this._eventName); 161 }.bind(this)); 162 }, 163 setItemList: function(itemList) 164 { 182 165 $(this).empty(); 166 itemList.forEach(function(item) { 167 var element = document.createElement('option'); 168 element.textContent = item.displayName; 169 element.value = item.name; 170 this.appendChild(element); 171 }.bind(this)); 183 172 $(this).show(); 184 builderNameList.forEach(function(builderName) { 185 var builderElement = document.createElement('option'); 186 builderElement.textContent = ui.displayNameForBuilder(builderName); 187 builderElement.value = builderName; 188 this.appendChild(builderElement); 189 }.bind(this)); 190 }, 191 select: function(builderName) { 192 var builderIndex = -1; 173 }, 174 select: function(itemName) { 175 var index = -1; 193 176 for (var i = 0; i < this.options.length; ++i) { 194 if (this.options[i].value == builderName) {195 builderIndex = i;177 if (this.options[i].value == itemName) { 178 index = i; 196 179 break; 197 180 } 198 181 } 199 if ( builderIndex == -1)182 if (index == -1) 200 183 return; 201 this.selectedIndex = builderIndex;202 }, 203 selected Builder: function() {184 this.selectedIndex = index; 185 }, 186 selectedItem: function() { 204 187 if (this.selectedIndex == -1) 205 188 return; … … 208 191 }); 209 192 193 ui.results.TestSelector = base.extends(Selector, { 194 init: function() 195 { 196 this.className = 'test-selector'; 197 this._eventName = 'testselected'; 198 }, 199 setTestList: function(testNameList) 200 { 201 this.setItemList(testNameList.map(function(testName) { 202 return { 203 'displayName': testName, 204 'name': testName 205 }; 206 })); 207 } 208 }); 209 210 ui.results.BuilderSelector = base.extends(Selector, { 211 init: function() 212 { 213 this.className = 'builder-selector'; 214 this._eventName = 'builderselected'; 215 }, 216 setBuilderList: function(builderNameList) { 217 this.setItemList(builderNameList.map(function(builderName) { 218 return { 219 'displayName': ui.displayNameForBuilder(builderName), 220 'name': builderName 221 }; 222 })); 223 } 224 }); 225 210 226 ui.results.View = base.extends('div', { 211 227 init: function(delegate) … … 217 233 this._builderSelector = new ui.results.BuilderSelector(); 218 234 this._resultsDetails = new ui.results.ResultsDetails(delegate); 219 220 $('.toolbar', this).prepend(new ui.actions.List([ 221 new ui.actions.Rebaseline().makeDefault(), 222 new ui.actions.Previous(), 223 new ui.actions.Next(), 224 ])); 235 this._actionList = new ui.actions.List(); 236 237 $('.toolbar', this).prepend(this._actionList); 225 238 $('.selector', this).append(this._testSelector).append(this._builderSelector); 226 239 $('.content', this).append(this._resultsDetails); 227 240 }, 241 addAction: function(action) 242 { 243 this._actionList.add(action); 244 }, 228 245 setTestList: function(testNameList) 229 246 { 230 247 this._testSelector.setTestList(testNameList); 231 248 }, 249 setBuilderList: function(buildNameList) 250 { 251 this._builderSelector.setBuilderList(buildNameList); 252 }, 232 253 currentTestName: function() 233 254 { 234 return this._testSelector. value;255 return this._testSelector.selectedItem(); 235 256 }, 236 257 currentBuilderName: function() 237 258 { 238 return this._builderSelector.selectedBuilder(); 239 }, 240 setBuilderList: function(buildNameList) 241 { 242 this._builderSelector.show(buildNameList); 259 return this._builderSelector.selectedItem(); 243 260 }, 244 261 showResults: function(failureInfo) 245 262 { 246 this._testSelector. value = failureInfo.testName;263 this._testSelector.select(failureInfo.testName); 247 264 this._builderSelector.select(failureInfo.builderName); 248 265 this._resultsDetails.show(failureInfo); -
trunk/Tools/ChangeLog
r93751 r93758 1 2011-08-24 Adam Barth <abarth@webkit.org> 2 3 The user can't close the details view in garden-o-matic 4 https://bugs.webkit.org/show_bug.cgi?id=66911 5 6 Reviewed by Dimitri Glazkov. 7 8 In addition to adding a close button, this patch changes the test 9 selector to use a <select> element and refactors the test selector to 10 share code with the builder selector. 11 12 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js: 13 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions.js: 14 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions_unittests.js: 15 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js: 16 1 17 2011-08-24 James Robinson <jamesr@chromium.org> 2 18
Note: See TracChangeset
for help on using the changeset viewer.