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

Enable device emulation, network throttling, and disable disk cache. #90

Merged
merged 3 commits into from Mar 29, 2016

Conversation

Projects
None yet
3 participants
@paulirish
Member

paulirish commented Mar 27, 2016

This follows the specs from #33.

Device

  • Nexus 5X screensize, DPR, etc.
  • Nexus 5X UA spoofing
  • Touch events
  • Overlay scrollbars, viewport emulation, etc, etc

Network

  • 150ms latency, 1.6Mbps throughput down, 768Kbps up
  • Cache disabled.

This PR depends on #88, so here's a cleaner diff between the two:
paulirish/lighthouse@paulirish:cri-encapsulate...emulation

Also now that all this works, we can load m.flipkart successfully, so I've switched the default to that. Results are already interesting. :)

Show outdated Hide outdated helpers/emulation.js
}
};
const DEVICE_EMULATION_USERAGENT = {

This comment has been minimized.

@brendankenny

brendankenny Mar 28, 2016

Member

is there going to be a good way to keep this in sync with shipping Chrome?

@brendankenny

brendankenny Mar 28, 2016

Member

is there going to be a good way to keep this in sync with shipping Chrome?

This comment has been minimized.

@paulirish

paulirish Mar 28, 2016

Member

I hope so, though devtools project hasnt found a good way, yet. :)

For us, we could do something along the lines of pinging the omahaproxy API every week

@paulirish

paulirish Mar 28, 2016

Member

I hope so, though devtools project hasnt found a good way, yet. :)

For us, we could do something along the lines of pinging the omahaproxy API every week

Show outdated Hide outdated helpers/emulation.js
/* eslint-disable no-proto */ /* global window, document */
const injectedFunction = function() {
const touchEvents = ['ontouchstart', 'ontouchend', 'ontouchmove', 'ontouchcancel'];
var recepients = [window.__proto__, document.__proto__];

This comment has been minimized.

@brendankenny
@brendankenny
@@ -0,0 +1,90 @@
/**

This comment has been minimized.

@brendankenny

brendankenny Mar 28, 2016

Member

we're going to have to restructure helpers/ soon

@brendankenny

brendankenny Mar 28, 2016

Member

we're going to have to restructure helpers/ soon

Show outdated Hide outdated index.js
@@ -16,7 +16,7 @@
*/
'use strict';
const defaultUrl = 'https://voice-memos.appspot.com';
const defaultUrl = 'https://m.flipkart.com';

This comment has been minimized.

@brendankenny

brendankenny Mar 28, 2016

Member

do we want m.flipkart.com or allow it to redirect from flipkart.com if it wants to?

@brendankenny

brendankenny Mar 28, 2016

Member

do we want m.flipkart.com or allow it to redirect from flipkart.com if it wants to?

@brendankenny brendankenny added the +1 label Mar 28, 2016

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Mar 29, 2016

Member

review?

Member

paulirish commented Mar 29, 2016

review?

@brendankenny

This comment has been minimized.

Show comment
Hide comment
@brendankenny

brendankenny Mar 29, 2016

Member

you'll have to fix your merge conflicts

Member

brendankenny commented Mar 29, 2016

you'll have to fix your merge conflicts

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Mar 29, 2016

Member

fixed

Member

paulirish commented Mar 29, 2016

fixed

emulation.enableNexus5X(this);
emulation.enableNetworkThrottling(this);
emulation.disableCache(this);
this.pendingCommandsComplete().then(_ => resolve());

This comment has been minimized.

@samccone

samccone Mar 29, 2016

Member

❤️

@samccone

samccone Mar 29, 2016

Member

❤️

@paulirish paulirish merged commit d0ed321 into GoogleChrome:master Mar 29, 2016

2 checks passed

cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@paulirish paulirish deleted the paulirish:emulation branch Apr 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment