Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js

Issue 2779103002: Convert context property tests to new Audit. (Closed)
Patch Set: Address review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-properties.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c2e006a553d7ba47b52dbfb780721a0facf1276a 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js
@@ -72,42 +72,33 @@ 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.
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.');
}
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-properties.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698