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

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

Merged
merged 3 commits into from Mar 29, 2016

Conversation

@paulirish
Copy link
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. :)

}
};

const DEVICE_EMULATION_USERAGENT = {

This comment has been minimized.

Copy link
@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.

Copy link
@paulirish

paulirish Mar 28, 2016

Author 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

/* 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.

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

This comment has been minimized.

Copy link
@brendankenny

brendankenny Mar 28, 2016

Member

we're going to have to restructure helpers/ soon

index.js Outdated
@@ -16,7 +16,7 @@
*/
'use strict';

const defaultUrl = 'https://voice-memos.appspot.com';
const defaultUrl = 'https://m.flipkart.com';

This comment has been minimized.

Copy link
@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
Copy link
Member Author

paulirish commented Mar 29, 2016

review?

@brendankenny
Copy link
Member

brendankenny commented Mar 29, 2016

you'll have to fix your merge conflicts

@paulirish
Copy link
Member Author

paulirish commented Mar 29, 2016

fixed

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

This comment has been minimized.

Copy link
@samccone

samccone Mar 29, 2016

Contributor

❤️

@paulirish paulirish merged commit d0ed321 into GoogleChrome:master Mar 29, 2016
2 checks passed
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.