Lines Matching defs:this

61     this.results = [];
62 this.time_start = Date.now();
80 this.subtests.push(subtest);
84 this.results.push(result);
89 this.time_end = Date.now();
90 this.results = this.results.filter((result) => {
101 this.results = [...prev.results, ...this.results];
102 this.time_start = prev.time_start;
103 this.time_end = Math.max(this.time_end, prev.time_end);
104 this.run_info = prev.run_info;
110 this.run_info = {
118 fs.writeFileSync('out/wpt/wptreport.json', JSON.stringify(this));
123 // TODO: get rid of this half-baked harness in favor of the one
152 this.path = path;
156 // We need to patch this to load the WebIDL parser
169 * @param {string} from the path of the file loading this resource,
176 const file = this.toRealFilePath(from, url);
193 this.key = key;
194 this.requires = value.requires || [];
195 this.fail = value.fail;
196 this.skip = value.skip;
198 this.pattern = this.transformPattern(pattern);
200 // TODO(joyeecheung): implement this
201 this.scope = value.scope;
202 this.comment = value.comment;
219 this.exactMatch = {};
220 this.patternMatch = [];
229 this.patternMatch.push(new StatusRule(key, rules[key], key));
232 this.exactMatch[normalizedPath] = new StatusRule(key, rules[key]);
239 const exact = this.exactMatch[file];
243 for (const item of this.patternMatch) {
262 this.module = mod;
263 this.filename = filename;
265 this.requires = new Set();
266 this.failedTests = [];
267 this.flakyTests = [];
268 this.skipReasons = [];
272 this.requires.add(req);
276 this.failedTests.push(...item.fail.expected);
279 this.failedTests.push(...item.fail.flaky);
280 this.flakyTests.push(...item.fail.flaky);
283 this.skipReasons.push(item.skip);
287 this.failedTests = [...new Set(this.failedTests)];
288 this.flakyTests = [...new Set(this.flakyTests)];
289 this.skipReasons = [...new Set(this.skipReasons)];
293 return path.join(this.module, this.filename);
297 return fixtures.path('wpt', this.getRelativePath());
301 return fs.readFileSync(this.getAbsolutePath(), 'utf8');
314 this.currentIntl = kIntlRequirement.none;
316 this.currentIntl = kIntlRequirement.none;
321 this.currentIntl = kIntlRequirement.small;
323 this.currentIntl = kIntlRequirement.full;
332 const current = this.currentIntl;
350 this.path = path;
351 this.loaded = false;
352 this.rules = new StatusRuleSet();
354 this.specs = [];
368 const list = this.grep(filepath);
382 const statusFile = path.join(dir, 'status', `${this.path}.json`);
384 this.rules.addRules(result);
386 const subDir = fixtures.path('wpt', this.path);
387 const list = this.grep(subDir);
390 const match = this.rules.match(relativePath);
391 this.specs.push(new WPTTestSpec(this.path, relativePath, match));
393 this.loaded = true;
407 this.path = path;
408 this.resource = new ResourceLoader(path);
410 this.flags = [];
411 this.globalThisInitScripts = [];
412 this.initScript = null;
414 this.status = new StatusLoader(path);
415 this.status.load();
416 this.specMap = new Map(
417 this.status.specs.map((item) => [item.filename, item]),
420 this.results = {};
421 this.inProgress = new Set();
422 this.workers = new Map();
423 this.unexpectedFailures = [];
425 this.scriptsModifier = null;
428 this.report = new WPTReport();
437 this.flags = flags;
445 this.initScript = script;
453 this.scriptsModifier = modifier;
457 let { initScript } = this;
466 if (this.globalThisInitScripts.length === null) {
470 const globalThisInitScript = this.globalThisInitScripts.join('\n\n//===\n');
487 this.globalThisInitScripts.push(
490 this.loadLazyGlobals();
527 this.globalThisInitScripts.push(script);
539 if (!this.specMap.has(filename)) {
542 queue.push(this.specMap.get(filename));
544 queue = this.buildQueue();
547 this.inProgress = new Set(queue.map((spec) => spec.filename));
552 const meta = spec.meta = this.getMeta(content);
567 filename: this.resource.toRealFilePath(relativePath, script),
568 code: this.resource.read(relativePath, script, false),
570 this.scriptsModifier?.(obj);
579 this.scriptsModifier?.(obj);
592 execArgv: this.flags,
596 wptPath: this.path,
597 initScript: this.fullInitScript(hasSubsetScript, variant),
605 this.workers.set(testFileName, worker);
611 reportResult ||= this.report?.addResult(`/${relativePath}${variant}`, 'OK');
612 return this.resultCallback(testFileName, message.result, reportResult);
614 return this.completionCallback(testFileName, message.status);
621 if (!this.inProgress.has(testFileName)) {
626 this.fail(
636 this.inProgress.delete(testFileName);
644 for (const spec of this.inProgress) {
645 this.fail(spec, { name: 'Incomplete' }, kIncomplete);
649 console.log(JSON.stringify(Object.keys(this.results).sort().reduce(
651 obj[key] = this.results[key];
660 for (const [key, item] of Object.entries(this.results)) {
682 if (this.results[key]?.skip) {
691 return this.results[key]?.fail?.expected?.includes(expectedToFail) !== true;
698 this.report?.write();
708 const file = path.join('test', 'wpt', 'status', `${this.path}.json`);
714 const file = path.join('test', 'wpt', 'status', `${this.path}.json`);
723 const spec = this.specMap.get(filename);
750 const status = this.getTestStatus(test.status);
751 const title = this.getTestTitle(filename);
757 this.fail(filename, test, status, reportResult);
759 this.succeed(filename, test, status, reportResult);
769 const status = this.getTestStatus(harnessStatus.status);
773 this.fail(filename, { name: 'WPT testharness timeout' }, kTimeout);
775 this.inProgress.delete(filename);
778 this.workers.get(filename).terminate();
782 let result = this.results[filename];
784 result = this.results[filename] = {};
812 const spec = this.specMap.get(filename);
830 this.addTestResult(filename, {
839 const title = this.getTestTitle(filename);
843 this.addTestResult(filename, {
874 for (const spec of this.specMap.values()) {
877 this.skip(filename, spec.skipReasons);
883 this.skip(filename, [ `requires ${lackingIntl}` ]);