Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into devtools-test-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Sep 14, 2020
2 parents f8806b2 + 5f2a8e2 commit 7b208f5
Show file tree
Hide file tree
Showing 67 changed files with 8,735 additions and 3,722 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/check-md-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Markdown Links Check
# runs every monday at 9 am
on:
schedule:
- cron: "0 9 * * 1"

jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
# checks all markdown files from /docs including all subfolders
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.github/workflows/markdown.links.config.json'
folder-path: 'docs/'
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
# checks all markdown files from root but ignores subfolders
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.github/workflows/markdown.links.config.json'
max-depth: 0
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
- run: sudo apt-get install xvfb
- name: Run smoke tests
run: xvfb-run --auto-servernum yarn smoke --debug -j=1 --retries=2 --invert-match ${{ matrix.smoke-test-invert }} $SMOKE_GROUP_1

# Only run smoke tests for windows against stable chrome.
smoke-windows:
runs-on: windows-latest
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/markdown.links.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ignorePatterns": [
{
"pattern": "^http://www.tmeter.ru"
},
{
"pattern": "https://github.com/GoogleChrome/lighthouse/workflows/\uD83D\uDCA1\uD83C\uDFE0/badge.svg"
}
]
}
2 changes: 2 additions & 0 deletions build/build-dt-report-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ writeFile('report.js', htmlReportAssets.REPORT_JAVASCRIPT);
writeFile('report.css', htmlReportAssets.REPORT_CSS);
writeFile('template.html', htmlReportAssets.REPORT_TEMPLATE);
writeFile('templates.html', htmlReportAssets.REPORT_TEMPLATES);
writeFile('report.d.ts', 'export {}');
writeFile('report-generator.d.ts', 'export {}');

const pathToReportAssets = require.resolve('../clients/devtools-report-assets.js');
browserify(generatorFilename, {standalone: 'Lighthouse.ReportGenerator'})
Expand Down
2 changes: 1 addition & 1 deletion docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ $ lighthouse --port=9222 --emulated-form-factor=none --throttling.cpuSlowdownMul

## Lighthouse as trace processor

Lighthouse can be used to analyze trace and performance data collected from other tools (like WebPageTest and ChromeDriver). The `traces` and `devtoolsLogs` artifact items can be provided using a string for the absolute path on disk if they're saved with `.trace.json` and `.devtoolslog.json` file extensions, respectively. The `devtoolsLogs` array is captured from the `Network` and `Page` domains (a la ChromeDriver's [enableNetwork and enablePage options]((https://sites.google.com/a/chromium.org/chromedriver/capabilities#TOC-perfLoggingPrefs-object)).
Lighthouse can be used to analyze trace and performance data collected from other tools (like WebPageTest and ChromeDriver). The `traces` and `devtoolsLogs` artifact items can be provided using a string for the absolute path on disk if they're saved with `.trace.json` and `.devtoolslog.json` file extensions, respectively. The `devtoolsLogs` array is captured from the `Network` and `Page` domains (a la ChromeDriver's [enableNetwork and enablePage options](https://sites.google.com/a/chromium.org/chromedriver/capabilities#TOC-perfLoggingPrefs-object)).

As an example, here's a trace-only run that reports on user timings and critical request chains:
Expand Down
8 changes: 6 additions & 2 deletions lighthouse-cli/test/fixtures/perf/delayed-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ setTimeout(() => {
textEl.textContent = 'Sorry!';
textEl.style.height = '18px' // this height can be flaky so we set it manually
const top = document.getElementById('late-content');
top.appendChild(imgEl);
top.appendChild(textEl);

// Use shadow DOM to verify devtoolsNodePath resolves through it
const shadowRoot = top.attachShadow({mode: 'open'});
const sectionEl = document.createElement('section');
sectionEl.append(imgEl, textEl);
shadowRoot.append(sectionEl);

// layout-shift-elements: ensure we can handle missing shift elements
if (window.location.href.includes('?missing')) {
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-cli/test/fixtures/perf/preload_tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ setTimeout(() => {
// load another origin in a way where the `crossorigin` attribute matters
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://fonts.googleapis.com/css?family=Roboto&display=block';
link.href = 'https://fonts.googleapis.com/css?family=Ranchers&display=block';
document.head.appendChild(link);

link.onload = () => {
// Make sure LCP is waiting on the network so the above resources are considered important.
const lcpElement = document.createElement('div');
lcpElement.style.fontFamily = 'Roboto';
lcpElement.style.fontFamily = 'Ranchers';
lcpElement.textContent = 'Here is some really tall text!'.repeat(50)
document.body.appendChild(lcpElement);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ module.exports = [
TraceElements: [
{
traceEventType: 'largest-contentful-paint',
selector: 'body > div#late-content > img',
nodeLabel: 'img',
snippet: '<img src="../dobetterweb/lighthouse-480x318.jpg">',
boundingRect: {
Expand Down Expand Up @@ -201,7 +200,6 @@ module.exports = [
},
{
traceEventType: 'layout-shift',
selector: 'body > div#late-content > div',
nodeLabel: 'Sorry!',
snippet: '<div style="height: 18px;">',
boundingRect: {
Expand Down Expand Up @@ -254,7 +252,7 @@ module.exports = [
node: {
type: 'node',
nodeLabel: 'img',
selector: 'body > div#late-content > img',
path: '0,HTML,1,BODY,1,DIV,a,#document-fragment,0,SECTION,0,IMG',
},
},
],
Expand Down
Loading

0 comments on commit 7b208f5

Please sign in to comment.