Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add utils/bisect.js to bisect chromium revisions #3511

Merged
merged 1 commit into from
Nov 9, 2018

Conversation

aslushnikov
Copy link
Contributor

This patch adds a new utility - utils/bisect.js - that accepts
a range of Chromium revisions and a pptr script and bisects the
range to figure when the script breaks.

The Puppeteer Script, given to the tool, should be exiting
with non-zero code to signify malfunctioning.

Example:

$ node utils/bisect.js --good 577361 --bad 599821 a.js

This patch adds a new utility - `utils/bisect.js` - that accepts
a range of Chromium revisions and a pptr script and bisects the
range to figure when the script breaks.

The Puppeteer Script, given to the tool, should be exiting
with non-zero code to signify malfunctioning.

Example:
```
$ node utils/bisect.js --good 577361 --bad 599821 a.js
```
@aslushnikov
Copy link
Contributor Author

Screenshot of me bisecting #3463:
image

Where the a.js is:

const puppeteer = require('.');

(async() => {
  const browser = await puppeteer.launch();

  const page = await browser.newPage();
  let success = true;
  await page.evaluate(async () => {
    const url = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
    const response = await window.fetch(url);
    const blob = await response.blob();
    const blobURL = URL.createObjectURL(blob);
    // Throws here:
    const response2 = await window.fetch(blobURL);
  }).catch(e => success = false);
  await browser.close();
  process.exit(success ? 0 : 1);
})();

Copy link
Collaborator

@JoelEinbinder JoelEinbinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add it to one of the contributing docs?

@aslushnikov
Copy link
Contributor Author

@JoelEinbinder let me add it later on - turns out I need bisecting again

@aslushnikov aslushnikov merged commit 6693537 into puppeteer:master Nov 9, 2018
@aslushnikov aslushnikov deleted the bisect branch January 22, 2019 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants