xref: /third_party/node/test/wpt/test-url.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/wpt/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst { WPTRunner } = require('../common/wpt');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciconst runner = new WPTRunner('url');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_cirunner.setScriptModifier((obj) => {
81cb0ef41Sopenharmony_ci  if (obj.filename.includes('toascii.window.js')) {
91cb0ef41Sopenharmony_ci    // `a` and `area` in `toascii.window.js` is for testing `Element` that
101cb0ef41Sopenharmony_ci    // created via `document.createElement`. So we need to ignore them and just
111cb0ef41Sopenharmony_ci    // test `URL`.
121cb0ef41Sopenharmony_ci    obj.code = obj.code.replace(/\["url", "a", "area"\]/, '[ "url" ]');
131cb0ef41Sopenharmony_ci  }
141cb0ef41Sopenharmony_ci});
151cb0ef41Sopenharmony_cirunner.pretendGlobalThisAs('Window');
161cb0ef41Sopenharmony_cirunner.setInitScript(`
171cb0ef41Sopenharmony_ci  globalThis.location ||= {};
181cb0ef41Sopenharmony_ci`);
191cb0ef41Sopenharmony_cirunner.runJsTests();
20

Indexes created Thu Nov 07 10:32:03 CST 2024