Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kkokkojeong committed Dec 23, 2024
1 parent 15e0728 commit 245d252
Showing 1 changed file with 10 additions and 46 deletions.
56 changes: 10 additions & 46 deletions test/integration/render/run_render_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ async function getImageFromStyle(styleForTest: StyleWithTestData, page: Page): P
}`;

const fragmentSource = `#version 300 es
out highp vec4 fragColor;
void main() {
fragColor = vec4(1.0, 0.0, 0.0, 1.0);
Expand Down Expand Up @@ -452,7 +452,7 @@ async function getImageFromStyle(styleForTest: StyleWithTestData, page: Page): P
// Inject MapLibre projection code
${shaderDescription.vertexShaderPrelude}
${shaderDescription.define}
in vec3 a_pos;
void main() {
Expand Down Expand Up @@ -983,55 +983,19 @@ async function executeRenderTests() {
}

const browser = await puppeteer.launch({
headless: !options.openBrowser,
headless: !options.openBrowser,
args: [
'--enable-webgl',
'--enable-webgl',
'--no-sandbox',
'--disable-web-security'
]});

const mimeTypes = {
'.html': 'text/html',
'.css': 'text/css',
'.js': 'text/javascript',
'.json': 'application/json',
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.mvt': 'application/vnd.mapbox-vector-tile',
'.webm': 'video/webm',
'.pbf': 'application/x-protobuf',
'.geojson': 'application/json',
};
const server = http.createServer((req, res) => {
const rootDir = path.resolve('test/integration/assets');
const filePath = path.resolve(`test/integration/assets${decodeURI(req.url.replace(/\?.*$/, ''))}`);

if (!filePath.startsWith(rootDir)) {
res.writeHead(403);
res.end('Forbidden');
return;
}

fs.readFile(filePath, (err, data) => {
if (err) {
res.writeHead(404);
res.end('File not found');
return;
}
const extname = path.extname(filePath);
let mimeType = mimeTypes[extname];
if (!mimeType) {
console.error(`Unknown mime type for file: ${filePath}`);
mimeType = 'application/json';
}
if (data.length === 0) {
res.writeHead(204);
} else {
res.writeHead(200, {'Content-Type': mimeType});
}
res.end(data);
});
});
const server = http.createServer(
st({
path: 'test/integration/assets',
cors: true,
})
);

const mvtServer = http.createServer(
st({
Expand Down

0 comments on commit 245d252

Please sign in to comment.