Bug 1844204 - [devtools] Move the damp test app from github to MC r=perftest-reviewers,devtools-reviewers,nchevobbe,kshampur

This patch pulls in the code from https://github.com/codehag/debugger-talos-example into the `app` folder.

The code structure is also now slightly different. There are now two folders, which `app` and `app-build`

The code in the `app` folder should now be where any further changes are made, this then gets built into `app_build` folder
which is used for the tests.

The idea is that the code in the `app-build` folder should not be changed manually, but it is rather always built
from `app`. See the readme for details.

Differential Revision: https://phabricator.services.mozilla.com/D184455
This commit is contained in:
Hubert Boma Manilla 2023-08-07 04:44:51 +00:00
parent 3b2efb9273
commit db30b37fd3
37 changed files with 20040 additions and 24 deletions

View file

@ -1472,7 +1472,7 @@ node_modules/
security/manager/tools/KnownRootHashes.json
security/manager/tools/PreloadedHPKPins.json
services/settings/dumps/
testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/static/js/minified.js
testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/app-build/static/js/minified.js
toolkit/components/nimbus/schemas/NimbusExperiment.schema.json
toolkit/components/pdfjs/content/PdfJsDefaultPreferences.sys.mjs
toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp

View file

@ -1,12 +0,0 @@
This is a fork of [Create React App](https://github.com/facebookincubator/create-react-app) that is
being used as part of the DAMP test tool suite. Files in `src` can be modified freely.
The URL for this repository is https://www.github.com/codehag/debugger-talos-example. Changes can be
added there
This package assumes yarn is installed.
To build and copy:
- ensure your firefox directory is listed in package.json under `firefox`.
- run `yarn copy-assets`

View file

@ -0,0 +1,10 @@
## Create React Test App Build
This is a fork of [Create React App](https://github.com/facebookincubator/create-react-app) that is
being used as part of the DAMP test tool suite.
This `app-build/` is built from the files in the `app/` folder.
Note: No changes should be made directly in this folder
For details on how to make changes and rebuild this app, see readme in `app/README.md`

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>iframe wrapper for the debugger custom page</title>
<style type="text/css">
html, body {
height: 100%;
width: 100%;
}
iframe {
border-style: none;
height: 100%;
position: absolute;
width: 100%;
}
</style>
</head>
<body>
<!-- For now we load the iframe in the same site as the damp top frame.
We will switch to a different-site URL (eg http://damp.iframe.com) when
DevTools work against remote frames. -->
<iframe src="http://damp.top.com/tests/devtools/addon/content/pages/custom/debugger/app-build/iframe.html"></iframe>
<script>
// We are using eval + sourceURL in order to prevent doing any HTTP request
// and speed up the test runtime.
for(let i = 0; i < 500; i++) {
eval("function evalScript() {} //# sourceURL=eval/eval-script-" + i +".js");
}
</script>
<script type="text/javascript" src="./static/js/main.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,12 @@
## Create React Test App
This is a fork of [Create React App](https://github.com/facebookincubator/create-react-app) that is
being used as part of the DAMP test tool suite. Files in `src` can be modified freely.
This package assumes yarn is installed.
This `app` is built into `app-build/` folder which is used for the damp tests
To build and copy this `app`:
- Run `yarn install` to install all the dependencies
- Make any needed changes in the `src` or `public` folders
- Run `yarn copy-assets` to re build the `app`

View file

@ -0,0 +1,98 @@
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @remove-on-eject-end
'use strict';
const fs = require('fs');
const path = require('path');
const paths = require('./paths');
// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve('./paths')];
const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
);
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
var dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
paths.dotenv,
].filter(Boolean);
// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.
// https://github.com/motdotla/dotenv
dotenvFiles.forEach(dotenvFile => {
if (fs.existsSync(dotenvFile)) {
require('dotenv').config({
path: dotenvFile,
});
}
});
// We support resolving modules according to `NODE_PATH`.
// This lets you use absolute paths in imports inside large monorepos:
// https://github.com/facebookincubator/create-react-app/issues/253.
// It works similar to `NODE_PATH` in Node itself:
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.join(path.delimiter);
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
// injected into the application via DefinePlugin in Webpack configuration.
const REACT_APP = /^REACT_APP_/i;
function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
return env;
},
{
// Useful for determining whether were running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: publicUrl,
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
};
return { raw, stringified };
}
module.exports = getClientEnvironment;

View file

@ -0,0 +1,118 @@
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @remove-on-eject-end
'use strict';
const path = require('path');
const fs = require('fs');
const url = require('url');
// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebookincubator/create-react-app/issues/637
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
const envPublicUrl = process.env.PUBLIC_URL;
function ensureSlash(path, needsSlash) {
const hasSlash = path.endsWith('/');
if (hasSlash && !needsSlash) {
return path.substr(path, path.length - 1);
} else if (!hasSlash && needsSlash) {
return `${path}/`;
} else {
return path;
}
}
const getPublicUrl = appPackageJson =>
envPublicUrl || require(appPackageJson).homepage;
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
// "public path" at which the app is served.
// Webpack needs to know it to put the right <script> hrefs into HTML even in
// single-page apps that may serve index.html for nested URLs like /todos/42.
// We can't use a relative path in HTML because we don't want to load something
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
function getServedPath(appPackageJson) {
const publicUrl = getPublicUrl(appPackageJson);
const servedUrl =
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');
return ensureSlash(servedUrl, true);
}
// config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp('.env'),
appBuild: resolveApp('build'),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveApp('src/index.js'),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
yarnLockFile: resolveApp('yarn.lock'),
testsSetup: resolveApp('src/setupTests.js'),
appNodeModules: resolveApp('node_modules'),
publicUrl: getPublicUrl(resolveApp('package.json')),
servedPath: getServedPath(resolveApp('package.json')),
};
// @remove-on-eject-begin
const resolveOwn = relativePath => path.resolve(__dirname, '..', relativePath);
// config before eject: we're in ./node_modules/react-scripts/config/
module.exports = {
dotenv: resolveApp('.env'),
appPath: resolveApp('.'),
appBuild: resolveApp('build'),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveApp('src/index.js'),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
yarnLockFile: resolveApp('yarn.lock'),
testsSetup: resolveApp('src/setupTests.js'),
appNodeModules: resolveApp('node_modules'),
publicUrl: getPublicUrl(resolveApp('package.json')),
servedPath: getServedPath(resolveApp('package.json')),
// These properties only exist before ejecting:
ownPath: resolveOwn('.'),
ownNodeModules: resolveOwn('node_modules'), // This is empty on npm 3
};
const ownPackageJson = require('../package.json');
const reactScriptsPath = resolveApp(`node_modules/${ownPackageJson.name}`);
const reactScriptsLinked =
fs.existsSync(reactScriptsPath) &&
fs.lstatSync(reactScriptsPath).isSymbolicLink();
// config before publish: we're in ./packages/react-scripts/config/
if (
!reactScriptsLinked &&
__dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1
) {
module.exports = {
dotenv: resolveOwn('template/.env'),
appPath: resolveApp('.'),
appBuild: resolveOwn('../../build'),
appPublic: resolveOwn('template/public'),
appHtml: resolveOwn('template/public/index.html'),
appIndexJs: resolveOwn('template/src/index.js'),
appPackageJson: resolveOwn('package.json'),
appSrc: resolveOwn('template/src'),
yarnLockFile: resolveOwn('template/yarn.lock'),
testsSetup: resolveOwn('template/src/setupTests.js'),
appNodeModules: resolveOwn('node_modules'),
publicUrl: getPublicUrl(resolveOwn('package.json')),
servedPath: getServedPath(resolveOwn('package.json')),
// These properties only exist before ejecting:
ownPath: resolveOwn('.'),
ownNodeModules: resolveOwn('node_modules'),
};
}
// @remove-on-eject-end

View file

@ -0,0 +1,30 @@
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @remove-on-eject-end
'use strict';
if (typeof Promise === 'undefined') {
// Rejection tracking prevents a common issue where React gets into an
// inconsistent state due to an error, but it gets swallowed by a Promise,
// and the user has no idea what causes React's erratic future behavior.
require('promise/lib/rejection-tracking').enable();
window.Promise = require('promise/lib/es6-extensions.js');
}
// fetch() polyfill for making API calls.
require('whatwg-fetch');
// Object.assign() is commonly used with React.
// It will use the native implementation if it's present and isn't buggy.
Object.assign = require('object-assign');
// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
// We don't polyfill it in the browser--this is user's responsibility.
if (process.env.NODE_ENV === 'test') {
require('raf').polyfill(global);
}

View file

@ -0,0 +1,369 @@
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @remove-on-eject-end
'use strict';
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const paths = require('./paths');
const getClientEnvironment = require('./env');
// Webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path.
const publicPath = paths.servedPath;
// Some apps do not use client-side routing with pushState.
// For these, "homepage" can be set to "." to enable relative asset paths.
const shouldUseRelativeAssetPaths = publicPath === './';
// Source maps are resource heavy and can cause out of memory issue for large source files.
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
const publicUrl = publicPath.slice(0, -1);
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);
// Assert this just to be safe.
// Development builds of React are slow and not intended for production.
if (env.stringified['process.env'].NODE_ENV !== '"production"') {
throw new Error('Production builds must have NODE_ENV=production.');
}
// Note: defined here because it will be used more than once.
const cssFilename = 'static/css/[name].[contenthash:8].css';
// ExtractTextPlugin expects the build output to be flat.
// (See https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/27)
// However, our output is structured with css, js and media folders.
// To have this structure working with relative paths, we have to use custom options.
const extractTextPluginOptions = shouldUseRelativeAssetPaths
? // Making sure that the publicPath goes back to to build folder.
{ publicPath: Array(cssFilename.split('/').length).join('../') }
: {};
// This is the production configuration.
// It compiles slowly and is focused on producing a fast and minimal bundle.
// The development configuration is different and lives in a separate file.
module.exports = {
// Don't attempt to continue if there are any errors.
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
devtool: shouldUseSourceMap ? 'source-map' : false,
// In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: {
// The build folder.
path: paths.appBuild,
// Generated JS file names (with nested folders).
// There will be one main bundle, and one file per asynchronous chunk.
// We don't currently advertise code splitting but Webpack supports it.
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
// We inferred the "public path" (such as / or /my-project) from homepage.
publicPath: publicPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: info =>
path
.relative(paths.appSrc, info.absoluteResourcePath)
.replace(/\\/g, '/'),
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules', paths.appNodeModules].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
alias: {
// @remove-on-eject-begin
// Resolve Babel runtime relative to react-scripts.
// It usually still works on npm 3 without this but it would be
// unfortunate to rely on, as react-scripts could be symlinked,
// and thus babel-runtime might not be resolvable from the source.
'babel-runtime': path.dirname(
require.resolve('babel-runtime/package.json')
),
// @remove-on-eject-end
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
],
},
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
// @remove-on-eject-begin
// TODO: consider separate config for production,
// e.g. to enable no-console and no-debugger only in production.
baseConfig: {
extends: [require.resolve('eslint-config-react-app')],
},
ignore: false,
useEslintrc: false,
// @remove-on-eject-end
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works just like "file" loader but it also embeds
// assets smaller than specified size as data URLs to avoid requests.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
// @remove-on-eject-begin
babelrc: false,
presets: [require.resolve('babel-preset-react-app')],
// @remove-on-eject-end
compact: true,
},
},
// The notation here is somewhat confusing.
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader normally turns CSS into JS modules injecting <style>,
// but unlike in development configuration, we do something different.
// `ExtractTextPlugin` first applies the "postcss" and "css" loaders
// (second argument), then grabs the result CSS and puts it into a
// separate file in our build process. This way we actually ship
// a single CSS file in production instead of JS code injecting <style>
// tags. If you use code splitting, however, any async bundles will still
// use the "style" loader inside the async code so CSS from them won't be
// in the main CSS file.
{
test: /\.css$/,
loader: ExtractTextPlugin.extract(
Object.assign(
{
fallback: {
loader: require.resolve('style-loader'),
options: {
hmr: false,
},
},
use: [
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
minimize: true,
sourceMap: shouldUseSourceMap,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
],
},
extractTextPluginOptions
)
),
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
// "file" loader makes sure assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.js$/, /\.html$/, /\.json$/],
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
],
},
plugins: [
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In production, it will be an empty string unless you specify "homepage"
// in `package.json`, in which case it will be the pathname of that URL.
new InterpolateHtmlPlugin(env.raw),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
minify: {
removeComments: false,
collapseWhitespace: false,
removeRedundantAttributes: false,
useShortDoctype: false,
removeEmptyAttributes: false,
removeStyleLinkTypeAttributes: false,
keepClosingSlash: true,
minifyJS: false,
minifyCSS: false,
minifyURLs: false,
},
}),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
// It is absolutely essential that NODE_ENV was set to production here.
// Otherwise React will be compiled in the very slow development mode.
new webpack.DefinePlugin(env.stringified),
// Minify the code.
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebookincubator/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
},
mangle: {
safari10: true,
},
output: {
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebookincubator/create-react-app/issues/2488
ascii_only: true,
},
sourceMap: shouldUseSourceMap,
}),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
new ExtractTextPlugin({
filename: cssFilename,
}),
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
new ManifestPlugin({
fileName: 'asset-manifest.json',
}),
// Generate a service worker script that will precache, and keep up to date,
// the HTML & assets that are part of the Webpack build.
new SWPrecacheWebpackPlugin({
// By default, a cache-busting query parameter is appended to requests
// used to populate the caches, to ensure the responses are fresh.
// If a URL is already hashed by Webpack, then there is no concern
// about it being stale, and the cache-busting can be skipped.
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
logger(message) {
if (message.indexOf('Total precache size is') === 0) {
// This message occurs for every build and is a bit too noisy.
return;
}
if (message.indexOf('Skipping static resource') === 0) {
// This message obscures real errors so we ignore it.
// https://github.com/facebookincubator/create-react-app/issues/2612
return;
}
console.log(message);
},
minify: true,
// For unknown URLs, fallback to the index page
navigateFallback: publicUrl + '/index.html',
// Ignores URLs starting from /__ (useful for Firebase):
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
navigateFallbackWhitelist: [/^(?!\/__).*/],
// Don't precache sourcemaps (they're large) and build asset manifest:
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
}),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
};

View file

@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
Notice the use of in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script type="text/javascript" src="/static/js/bundle.js"></script>
<script type="text/javascript" src="/public/js/test0.js"></script>
<script type="text/javascript" src="/public/js/test1.js"></script>
<script type="text/javascript" src="/public/js/test2.js"></script>
<script type="text/javascript" src="/public/js/test3.js"></script>
<script type="text/javascript" src="/public/js/test4.js"></script>
<script type="text/javascript" src="/public/js/test5.js"></script>
<script type="text/javascript" src="/public/js/test6.js"></script>
<script type="text/javascript" src="/public/js/test7.js"></script>
<script type="text/javascript" src="/public/js/test8.js"></script>
<script type="text/javascript" src="/public/js/test9.js"></script>
<script type="text/javascript" src="/public/js/test10.js"></script>
<script type="text/javascript" src="/public/js/test11.js"></script>
<script type="text/javascript" src="/public/js/test12.js"></script>
<script type="text/javascript" src="/public/js/test13.js"></script>
<script type="text/javascript" src="/public/js/test14.js"></script>
<script type="text/javascript" src="/public/js/test15.js"></script>
<script type="text/javascript" src="/public/js/test16.js"></script>
<script type="text/javascript" src="/public/js/test17.js"></script>
<script type="text/javascript" src="/public/js/test18.js"></script>
<script type="text/javascript" src="/public/js/test19.js"></script>
<script type="text/javascript" src="/public/js/test20.js"></script>
<script type="text/javascript" src="/public/js/test21.js"></script>
<script type="text/javascript" src="/public/js/test22.js"></script>
<script type="text/javascript" src="/public/js/test23.js"></script>
<script type="text/javascript" src="/public/js/test24.js"></script>
<script type="text/javascript" src="/public/js/test25.js"></script>
<script type="text/javascript" src="/public/js/test26.js"></script>
<script type="text/javascript" src="/public/js/test27.js"></script>
<script type="text/javascript" src="/public/js/test28.js"></script>
<script type="text/javascript" src="/public/js/test29.js"></script>
<script type="text/javascript" src="/public/js/test30.js"></script>
<script type="text/javascript" src="/public/js/test31.js"></script>
<script type="text/javascript" src="/public/js/test32.js"></script>
<script type="text/javascript" src="/public/js/test33.js"></script>
<script type="text/javascript" src="/public/js/test34.js"></script>
<script type="text/javascript" src="/public/js/test35.js"></script>
<script type="text/javascript" src="/public/js/test36.js"></script>
<script type="text/javascript" src="/public/js/test37.js"></script>
<script type="text/javascript" src="/public/js/test38.js"></script>
<script type="text/javascript" src="/public/js/test39.js"></script>
<script type="text/javascript" src="/public/js/test40.js"></script>
<script type="text/javascript" src="/public/js/test41.js"></script>
<script type="text/javascript" src="/public/js/test42.js"></script>
<script type="text/javascript" src="/public/js/test43.js"></script>
<script type="text/javascript" src="/public/js/test44.js"></script>
<script type="text/javascript" src="/public/js/test45.js"></script>
<script type="text/javascript" src="/public/js/test46.js"></script>
<script type="text/javascript" src="/public/js/test47.js"></script>
<script type="text/javascript" src="/public/js/test48.js"></script>
<script type="text/javascript" src="/public/js/test49.js"></script>
<script type="text/javascript" src="/public/js/test50.js"></script>
<script type="text/javascript" src="/public/js/test51.js"></script>
<script type="text/javascript" src="/public/js/test52.js"></script>
<script type="text/javascript" src="/public/js/test53.js"></script>
<script type="text/javascript" src="/public/js/test54.js"></script>
<script type="text/javascript" src="/public/js/test55.js"></script>
<script type="text/javascript" src="/public/js/test56.js"></script>
<script type="text/javascript" src="/public/js/test57.js"></script>
<script type="text/javascript" src="/public/js/test58.js"></script>
<script type="text/javascript" src="/public/js/test59.js"></script>
<script type="text/javascript" src="/public/js/test60.js"></script>
<script type="text/javascript" src="/public/js/test61.js"></script>
<script type="text/javascript" src="/public/js/test62.js"></script>
<script type="text/javascript" src="/public/js/test63.js"></script>
<script type="text/javascript" src="/public/js/test64.js"></script>
<script type="text/javascript" src="/public/js/test65.js"></script>
<script type="text/javascript" src="/public/js/test66.js"></script>
<script type="text/javascript" src="/public/js/test67.js"></script>
<script type="text/javascript" src="/public/js/test68.js"></script>
<script type="text/javascript" src="/public/js/test69.js"></script>
<script type="text/javascript" src="/public/js/test70.js"></script>
<script type="text/javascript" src="/public/js/test71.js"></script>
<script type="text/javascript" src="/public/js/test72.js"></script>
<script type="text/javascript" src="/public/js/test73.js"></script>
<script type="text/javascript" src="/public/js/test74.js"></script>
<script type="text/javascript" src="/public/js/test75.js"></script>
<script type="text/javascript" src="/public/js/test76.js"></script>
<script type="text/javascript" src="/public/js/test77.js"></script>
<script type="text/javascript" src="/public/js/test78.js"></script>
<script type="text/javascript" src="/public/js/test79.js"></script>
<script type="text/javascript" src="/public/js/test80.js"></script>
<script type="text/javascript" src="/public/js/test81.js"></script>
<script type="text/javascript" src="/public/js/test82.js"></script>
<script type="text/javascript" src="/public/js/test83.js"></script>
<script type="text/javascript" src="/public/js/test84.js"></script>
<script type="text/javascript" src="/public/js/test85.js"></script>
<script type="text/javascript" src="/public/js/test86.js"></script>
<script type="text/javascript" src="/public/js/test87.js"></script>
<script type="text/javascript" src="/public/js/test88.js"></script>
<script type="text/javascript" src="/public/js/test89.js"></script>
<script type="text/javascript" src="/public/js/test90.js"></script>
<script type="text/javascript" src="/public/js/test91.js"></script>
<script type="text/javascript" src="/public/js/test92.js"></script>
<script type="text/javascript" src="/public/js/test93.js"></script>
<script type="text/javascript" src="/public/js/test94.js"></script>
<script type="text/javascript" src="/public/js/test95.js"></script>
<script type="text/javascript" src="/public/js/test96.js"></script>
<script type="text/javascript" src="/public/js/test97.js"></script>
<script type="text/javascript" src="/public/js/test98.js"></script>
<script type="text/javascript" src="/public/js/test99.js"></script>
<script type="text/javascript" src="/public/js/test100.js"></script>
</body>
</html>

View file

@ -0,0 +1,25 @@
{
"name": "create-reate-test-app",
"description": "A test app forked from meta's create-react-app and modified to test sourcemap debugging scenarios",
"version": "0.1.0",
"private": true,
"homepage": "./",
"dependencies": {
"eslint": "^4.17.0",
"eslint-config-react-app": "2.0.1",
"eslint-loader": "1.9.0",
"eslint-plugin-flowtype": "2.39.1",
"immutable": "^3.8.2",
"lodash": "^4.17.5",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.0.17"
},
"scripts": {
"build": "node ./scripts/build; rm ./build/service-worker.js ./build/asset-manifest.json",
"clean-build": "rm -r ./build && rm -r ./node_modules",
"clean-old-assets": "rm -r ../app-build || true",
"copy-assets": "yarn clean-old-assets; yarn build; cp -r ./build ../app-build; yarn clean-build",
"copy-assets-windows": "yarn build; cp -r ./build ../app-build"
}
}

View file

@ -0,0 +1,10 @@
## Create React Test App Build
This is a fork of [Create React App](https://github.com/facebookincubator/create-react-app) that is
being used as part of the DAMP test tool suite.
This `app-build/` is built from the files in the `app/` folder.
Note: No changes should be made directly in this folder
For details on how to make changes and rebuild this app, see readme in `app/README.md`

View file

@ -0,0 +1,147 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
Notice the use of . in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "./favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<script type="text/javascript" src="./js/testfile.js?id=0"></script>
<script type="text/javascript" src="./js/testfile.js?id=1"></script>
<script type="text/javascript" src="./js/testfile.js?id=2"></script>
<script type="text/javascript" src="./js/testfile.js?id=3"></script>
<script type="text/javascript" src="./js/testfile.js?id=4"></script>
<script type="text/javascript" src="./js/testfile.js?id=5"></script>
<script type="text/javascript" src="./js/testfile.js?id=6"></script>
<script type="text/javascript" src="./js/testfile.js?id=7"></script>
<script type="text/javascript" src="./js/testfile.js?id=8"></script>
<script type="text/javascript" src="./js/testfile.js?id=9"></script>
<script type="text/javascript" src="./js/testfile.js?id=10"></script>
<script type="text/javascript" src="./js/testfile.js?id=11"></script>
<script type="text/javascript" src="./js/testfile.js?id=12"></script>
<script type="text/javascript" src="./js/testfile.js?id=13"></script>
<script type="text/javascript" src="./js/testfile.js?id=14"></script>
<script type="text/javascript" src="./js/testfile.js?id=15"></script>
<script type="text/javascript" src="./js/testfile.js?id=16"></script>
<script type="text/javascript" src="./js/testfile.js?id=17"></script>
<script type="text/javascript" src="./js/testfile.js?id=18"></script>
<script type="text/javascript" src="./js/testfile.js?id=19"></script>
<script type="text/javascript" src="./js/testfile.js?id=20"></script>
<script type="text/javascript" src="./js/testfile.js?id=21"></script>
<script type="text/javascript" src="./js/testfile.js?id=22"></script>
<script type="text/javascript" src="./js/testfile.js?id=23"></script>
<script type="text/javascript" src="./js/testfile.js?id=24"></script>
<script type="text/javascript" src="./js/testfile.js?id=25"></script>
<script type="text/javascript" src="./js/testfile.js?id=26"></script>
<script type="text/javascript" src="./js/testfile.js?id=27"></script>
<script type="text/javascript" src="./js/testfile.js?id=28"></script>
<script type="text/javascript" src="./js/testfile.js?id=29"></script>
<script type="text/javascript" src="./js/testfile.js?id=30"></script>
<script type="text/javascript" src="./js/testfile.js?id=31"></script>
<script type="text/javascript" src="./js/testfile.js?id=32"></script>
<script type="text/javascript" src="./js/testfile.js?id=33"></script>
<script type="text/javascript" src="./js/testfile.js?id=34"></script>
<script type="text/javascript" src="./js/testfile.js?id=35"></script>
<script type="text/javascript" src="./js/testfile.js?id=36"></script>
<script type="text/javascript" src="./js/testfile.js?id=37"></script>
<script type="text/javascript" src="./js/testfile.js?id=38"></script>
<script type="text/javascript" src="./js/testfile.js?id=39"></script>
<script type="text/javascript" src="./js/testfile.js?id=40"></script>
<script type="text/javascript" src="./js/testfile.js?id=41"></script>
<script type="text/javascript" src="./js/testfile.js?id=42"></script>
<script type="text/javascript" src="./js/testfile.js?id=43"></script>
<script type="text/javascript" src="./js/testfile.js?id=44"></script>
<script type="text/javascript" src="./js/testfile.js?id=45"></script>
<script type="text/javascript" src="./js/testfile.js?id=46"></script>
<script type="text/javascript" src="./js/testfile.js?id=47"></script>
<script type="text/javascript" src="./js/testfile.js?id=48"></script>
<script type="text/javascript" src="./js/testfile.js?id=49"></script>
<script type="text/javascript" src="./js/testfile.js?id=50"></script>
<script type="text/javascript" src="./js/testfile.js?id=51"></script>
<script type="text/javascript" src="./js/testfile.js?id=52"></script>
<script type="text/javascript" src="./js/testfile.js?id=53"></script>
<script type="text/javascript" src="./js/testfile.js?id=54"></script>
<script type="text/javascript" src="./js/testfile.js?id=55"></script>
<script type="text/javascript" src="./js/testfile.js?id=56"></script>
<script type="text/javascript" src="./js/testfile.js?id=57"></script>
<script type="text/javascript" src="./js/testfile.js?id=58"></script>
<script type="text/javascript" src="./js/testfile.js?id=59"></script>
<script type="text/javascript" src="./js/testfile.js?id=60"></script>
<script type="text/javascript" src="./js/testfile.js?id=61"></script>
<script type="text/javascript" src="./js/testfile.js?id=62"></script>
<script type="text/javascript" src="./js/testfile.js?id=63"></script>
<script type="text/javascript" src="./js/testfile.js?id=64"></script>
<script type="text/javascript" src="./js/testfile.js?id=65"></script>
<script type="text/javascript" src="./js/testfile.js?id=66"></script>
<script type="text/javascript" src="./js/testfile.js?id=67"></script>
<script type="text/javascript" src="./js/testfile.js?id=68"></script>
<script type="text/javascript" src="./js/testfile.js?id=69"></script>
<script type="text/javascript" src="./js/testfile.js?id=70"></script>
<script type="text/javascript" src="./js/testfile.js?id=71"></script>
<script type="text/javascript" src="./js/testfile.js?id=72"></script>
<script type="text/javascript" src="./js/testfile.js?id=73"></script>
<script type="text/javascript" src="./js/testfile.js?id=74"></script>
<script type="text/javascript" src="./js/testfile.js?id=75"></script>
<script type="text/javascript" src="./js/testfile.js?id=76"></script>
<script type="text/javascript" src="./js/testfile.js?id=77"></script>
<script type="text/javascript" src="./js/testfile.js?id=78"></script>
<script type="text/javascript" src="./js/testfile.js?id=79"></script>
<script type="text/javascript" src="./js/testfile.js?id=80"></script>
<script type="text/javascript" src="./js/testfile.js?id=81"></script>
<script type="text/javascript" src="./js/testfile.js?id=82"></script>
<script type="text/javascript" src="./js/testfile.js?id=83"></script>
<script type="text/javascript" src="./js/testfile.js?id=84"></script>
<script type="text/javascript" src="./js/testfile.js?id=85"></script>
<script type="text/javascript" src="./js/testfile.js?id=86"></script>
<script type="text/javascript" src="./js/testfile.js?id=87"></script>
<script type="text/javascript" src="./js/testfile.js?id=88"></script>
<script type="text/javascript" src="./js/testfile.js?id=89"></script>
<script type="text/javascript" src="./js/testfile.js?id=90"></script>
<script type="text/javascript" src="./js/testfile.js?id=91"></script>
<script type="text/javascript" src="./js/testfile.js?id=92"></script>
<script type="text/javascript" src="./js/testfile.js?id=93"></script>
<script type="text/javascript" src="./js/testfile.js?id=94"></script>
<script type="text/javascript" src="./js/testfile.js?id=95"></script>
<script type="text/javascript" src="./js/testfile.js?id=96"></script>
<script type="text/javascript" src="./js/testfile.js?id=97"></script>
<script type="text/javascript" src="./js/testfile.js?id=98"></script>
<script type="text/javascript" src="./js/testfile.js?id=99"></script>
<script type="text/javascript" src="./js/testfile.js?id=100"></script>
<script type="text/javascript" src="./js/subfolder/testsubfolder.js"></script>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script type="text/javascript" src="./static/js/main.js"></script></body>
<script>
// We are using eval + sourceURL in order to prevent doing any HTTP request
// and speed up the test runtime.
for(let i = 0; i < 250; i++) {
eval("function evalScript() {} //# sourceURL=foo/eval-script-" + i +".js");
}
for(let i = 0; i < 250; i++) {
eval("function evalScript() {} //# sourceURL=foo/bar/plop/eval-script-" + i +".js");
}
</script>
</html>

View file

@ -22,7 +22,7 @@
We will switch to a different-site URL (eg http://damp.iframe.com) when
DevTools work against remote frames. -->
<iframe
src="http://damp.top.com/tests/devtools/addon/content/pages/custom/debugger/iframe.html"
src="http://damp.top.com/tests/devtools/addon/content/pages/custom/debugger/app-build/iframe.html"
></iframe>
<script>

View file

@ -0,0 +1,5 @@
(function () {
function fSubFolder() {
return Math.random();
}
});

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,158 @@
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @remove-on-eject-end
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const path = require('path');
const chalk = require('chalk');
const fs = require('fs-extra');
const webpack = require('webpack');
const config = require('../config/webpack.config.prod');
const paths = require('../config/paths');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
const measureFileSizesBeforeBuild =
FileSizeReporter.measureFileSizesBeforeBuild;
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
const useYarn = fs.existsSync(paths.yarnLockFile);
// These sizes are pretty large. We'll warn for bundles exceeding them.
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}
// First, read the current file sizes in build directory.
// This lets us display how much they changed later.
measureFileSizesBeforeBuild(paths.appBuild)
.then(previousFileSizes => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
fs.emptyDirSync(paths.appBuild);
// Merge with the public folder
copyPublicFolder();
// Start the webpack build
return build(previousFileSizes);
})
.then(
({ stats, previousFileSizes, warnings }) => {
if (warnings.length) {
console.log(chalk.yellow('Compiled with warnings.\n'));
console.log(warnings.join('\n\n'));
console.log(
'\nSearch for the ' +
chalk.underline(chalk.yellow('keywords')) +
' to learn more about each warning.'
);
console.log(
'To ignore, add ' +
chalk.cyan('// eslint-disable-next-line') +
' to the line before.\n'
);
} else {
console.log(chalk.green('Compiled successfully.\n'));
}
console.log('File sizes after gzip:\n');
printFileSizesAfterBuild(
stats,
previousFileSizes,
paths.appBuild,
WARN_AFTER_BUNDLE_GZIP_SIZE,
WARN_AFTER_CHUNK_GZIP_SIZE
);
console.log();
const appPackage = require(paths.appPackageJson);
const publicUrl = paths.publicUrl;
const publicPath = config.output.publicPath;
const buildFolder = path.relative(process.cwd(), paths.appBuild);
printHostingInstructions(
appPackage,
publicUrl,
publicPath,
buildFolder,
useYarn
);
},
err => {
console.log(chalk.red('Failed to compile.\n'));
printBuildError(err);
process.exit(1);
}
);
// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
console.log('Creating an optimized production build...');
let compiler = webpack(config);
return new Promise((resolve, reject) => {
compiler.run((err, stats) => {
if (err) {
return reject(err);
}
const messages = formatWebpackMessages(stats.toJson({}, true));
if (messages.errors.length) {
// Only keep the first error. Others are often indicative
// of the same problem, but confuse the reader with noise.
if (messages.errors.length > 1) {
messages.errors.length = 1;
}
return reject(new Error(messages.errors.join('\n\n')));
}
if (
process.env.CI &&
(typeof process.env.CI !== 'string' ||
process.env.CI.toLowerCase() !== 'false') &&
messages.warnings.length
) {
console.log(
chalk.yellow(
'\nTreating warnings as errors because process.env.CI = true.\n' +
'Most CI servers set it automatically.\n'
)
);
return reject(new Error(messages.warnings.join('\n\n')));
}
return resolve({
stats,
previousFileSizes,
warnings: messages.warnings,
});
});
});
}
function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
dereference: true,
filter: file => file !== paths.appHtml,
});
}

View file

@ -0,0 +1,35 @@
import React, { Component } from 'react';
import { stepInTest, debugStatement } from './step-in-test.js';
import stepOverTest from './step-over-test.js';
import stepOutTest from './step-out-test.js';
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
);
}
}
window.hitBreakpoint = function breakpoint() {
stepInTest();
stepOverTest();
stepOutTest();
console.log('hitting a breakpoint');
return;
}
window.hitDebugStatement = function() {
debugStatement();
console.log('hitting a debug statement');
return;
}
export default App;

View file

@ -0,0 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
});

View file

@ -0,0 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));

View file

@ -0,0 +1,28 @@
function squareAndOne(arg){
return (arg * arg) + 1;
}
function squareUntil(arg, limit){
if(arg * arg >= limit){
return arg * arg;
}else{
return squareUntil(arg * arg, limit);
}
}
function addUntil(arg1, arg2, limit){
if(arg1 + arg2 > limit){
return arg1 + arg2;
}else{
return addUntil(arg1 + arg2, arg2, limit);
}
}
function testStart(aArg) {
var r = 10;
var a = squareAndOne(r);
var b = squareUntil(r, 99999999999); //recurses 3 times, returns on 4th call
var c = addUntil(r, 5, 1050); // recurses 208 times and returns on the 209th call
return a + b + c;
}
export default testStart;

File diff suppressed because one or more lines are too long

View file

@ -36,14 +36,14 @@ const IFRAME_BASE_URL =
const EXPECTED = {
sources: 107,
file: "App.js",
sourceURL: `${IFRAME_BASE_URL}custom/debugger/static/js/App.js`,
sourceURL: `${IFRAME_BASE_URL}custom/debugger/app-build/static/js/App.js`,
text: "import React, { Component } from 'react';",
threadsCount: 2,
};
const EXPECTED_FUNCTION = "window.hitBreakpoint()";
const TEST_URL = PAGES_BASE_URL + "custom/debugger/index.html";
const TEST_URL = PAGES_BASE_URL + "custom/debugger/app-build/index.html";
module.exports = async function () {
const tab = await testSetup(TEST_URL, { disableCache: true });
@ -169,7 +169,7 @@ async function testPreview(dbg, tab, testFunction) {
async function testOpeningLargeMinifiedFile(dbg, tab) {
dump("Add minified.js (large minified file)\n");
const file = `${IFRAME_BASE_URL}custom/debugger/static/js/minified.js`;
const file = `${IFRAME_BASE_URL}custom/debugger/app-build/static/js/minified.js`;
const messageManager = tab.linkedBrowser.messageManager;
@ -217,7 +217,7 @@ async function testPrettyPrint(dbg) {
// Disable source map so we can prettyprint main.js
await dbg.actions.toggleSourceMapsEnabled(false);
const fileUrl = `${IFRAME_BASE_URL}custom/debugger/static/js/main.js`;
const fileUrl = `${IFRAME_BASE_URL}custom/debugger/app-build/static/js/main.js`;
const formattedFileUrl = `${fileUrl}:formatted`;
dump("Select minified file\n");

View file

@ -63,7 +63,7 @@ excluded_from_imports_prefix = list(
"devtools/client/shared/source-map-loader/test/browser/fixtures/bundle.js",
"layout/style/test/property_database.js",
"services/fxaccounts/FxAccountsPairingChannel.js",
"testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/static/js/main.js", # noqa E501
"testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/app-build/static/js/main.js", # noqa E501
"testing/web-platform/",
# Unrelated testcases that has edge case syntax.
"browser/components/sessionstore/test/unit/data/",

View file

@ -224,7 +224,8 @@ avoid-blacklist-and-whitelist:
- testing/mozharness/configs/unittests/win_unittest.py
- testing/profiles/unittest-required/user.js
- testing/raptor/browsertime/browsertime_scenario.js
- testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/static/js/main.js
- testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/app/config/webpack.config.prod.js
- testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/app-build/static/js/main.js
- testing/web-platform/tests/tools/manifest/tests/test_manifest.py
- toolkit/actors/RemotePageChild.sys.mjs
- toolkit/actors/WebChannelChild.sys.mjs

View file

@ -20,7 +20,7 @@ node_modules/
security/manager/tools/KnownRootHashes.json
security/manager/tools/PreloadedHPKPins.json
services/settings/dumps/
testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/static/js/minified.js
testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/app-build/static/js/minified.js
toolkit/components/nimbus/schemas/NimbusExperiment.schema.json
toolkit/components/pdfjs/content/PdfJsDefaultPreferences.sys.mjs
toolkit/components/uniffi-js/UniFFIGeneratedScaffolding.cpp