Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js b/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js |
| index b04e91a6e7baae7fe2fb4810d25268300c1e53db..80b286c221e47eda9a82807e37d91e44c6501065 100644 |
| --- a/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js |
| +++ b/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js |
| @@ -72,42 +72,34 @@ let OfflineAudioContextOwnProperties = [ |
| * @param {Function} should |Should| assertion function. |
| * @return {Map} Verification result map. |
| */ |
| -function verifyPrototypeOwnProperties (targetPrototype, populatedList, should) { |
| +function verifyPrototypeOwnProperties(targetPrototype, populatedList, should) { |
| let propertyMap = new Map(); |
| let generatedList = Object.getOwnPropertyNames(targetPrototype); |
| for (let index in populatedList) { |
| - propertyMap.set(populatedList[index], { |
| - actual: false, |
| - expected: true |
| - }); |
| + propertyMap.set(populatedList[index], {actual: false, expected: true}); |
| } |
| for (let index in generatedList) { |
| if (propertyMap.has(generatedList[index])) { |
| propertyMap.get(generatedList[index]).actual = true; |
| } else { |
| - propertyMap.set(generatedList[index], { |
| - actual: true, |
| - expected: false |
| - }); |
| + propertyMap.set(generatedList[index], {actual: true, expected: false}); |
| } |
| } |
| // TODO(hongchan): replace the Should assertion when the new test infra lands. |
|
hongchan
2017/04/04 21:18:17
Can you remove this comment as well?
Raymond Toy
2017/04/04 21:41:40
Done.
|
| for (let [property, result] of propertyMap) { |
| + let prefix = 'The property "' + property + '"'; |
| if (result.expected && result.actual) { |
| // The test meets the expectation. |
| - should('The property "' + property + '"') |
| - ._testPassed('was expected and found successfully', false); |
| + should(true, prefix).message('was expected and found successfully', ''); |
| } else if (result.expected && !result.actual) { |
| // The expected property is missing. |
| - should('The property "' + property + '" was expected but not found.') |
| - ._testFailed('', false); |
| + should(false, prefix).message('', 'was expected but not found.'); |
| } else if (!result.expected && result.actual) { |
| // Something unexpected was found. |
| - should('The property "' + property + '" was not expected but found.') |
| - ._testFailed('', false); |
| + should(false, prefix).message('', 'was not expected but found.'); |
| } |
| } |
| } |