| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // Called by the common.js module. | 4 // Called by the common.js module. |
| 5 function moduleDidLoad() { | 5 function moduleDidLoad() { |
| 6 // The module is not hidden by default so we can easily see if the plugin | 6 // The module is not hidden by default so we can easily see if the plugin |
| 7 // failed to load. | 7 // failed to load. |
| 8 common.hideModule(); | 8 common.hideModule(); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 function endCommand(testName, testResult) { | 40 function endCommand(testName, testResult) { |
| 41 var testRowEl = currentTestEl.querySelector('.row'); | 41 var testRowEl = currentTestEl.querySelector('.row'); |
| 42 var testResultEl = currentTestEl.querySelector('.result'); | 42 var testResultEl = currentTestEl.querySelector('.result'); |
| 43 testRowEl.classList.add(testResult); | 43 testRowEl.classList.add(testResult); |
| 44 testResultEl.textContent = testResult; | 44 testResultEl.textContent = testResult; |
| 45 } | 45 } |
| 46 | 46 |
| 47 function testendCommand() { | 47 function testendCommand() { |
| 48 testsFinished = true; | 48 testsFinished = true; |
| 49 common.removeModule(); |
| 50 |
| 51 if (failedTests) { |
| 52 common.updateStatus('FAILED'); |
| 53 document.getElementById('statusField').classList.add('failed'); |
| 54 } else { |
| 55 common.updateStatus('OK'); |
| 56 document.getElementById('statusField').classList.add('ok'); |
| 57 } |
| 49 } | 58 } |
| 50 | 59 |
| 51 function handleMessage(event) { | 60 function handleMessage(event) { |
| 52 var msg = event.data; | 61 var msg = event.data; |
| 53 var firstColon = msg.indexOf(':'); | 62 var firstColon = msg.indexOf(':'); |
| 54 var cmd = firstColon !== -1 ? msg.substr(0, firstColon) : msg; | 63 var cmd = firstColon !== -1 ? msg.substr(0, firstColon) : msg; |
| 55 var cmdFunctionName = cmd + 'Command'; | 64 var cmdFunctionName = cmd + 'Command'; |
| 56 var cmdFunction = window[cmdFunctionName]; | 65 var cmdFunction = window[cmdFunctionName]; |
| 57 | 66 |
| 58 if (typeof(cmdFunction) !== 'function') { | 67 if (typeof(cmdFunction) !== 'function') { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 83 argList = argList.substr(comma + 1); | 92 argList = argList.substr(comma + 1); |
| 84 } | 93 } |
| 85 args.push(arg); | 94 args.push(arg); |
| 86 } | 95 } |
| 87 | 96 |
| 88 // Last argument is the rest of the message. | 97 // Last argument is the rest of the message. |
| 89 args.push(argList); | 98 args.push(argList); |
| 90 | 99 |
| 91 cmdFunction.apply(null, args); | 100 cmdFunction.apply(null, args); |
| 92 } | 101 } |
| OLD | NEW |