Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2269)

Unified Diff: Source/devtools/front_end/emulation/OverridesSupport.js

Issue 1298503003: DevTools: fix control flow in OverridesSupport.setDeviceMetricsOverride (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@throttler
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/emulation/OverridesSupport.js
diff --git a/Source/devtools/front_end/emulation/OverridesSupport.js b/Source/devtools/front_end/emulation/OverridesSupport.js
index 59102f1a0fab65f17d54d32ba0beac6c47ec2313..ddfd646967b9c4d1f89d1a6a420b8df30ee30eac 100644
--- a/Source/devtools/front_end/emulation/OverridesSupport.js
+++ b/Source/devtools/front_end/emulation/OverridesSupport.js
@@ -604,22 +604,23 @@ WebInspector.OverridesSupport.prototype = {
/**
* @this {WebInspector.OverridesSupport}
- * @return {!Promise.<undefined>}
+ * @return {!Promise.<?>}
*/
function setDeviceMetricsOverride()
{
- var promise = this._target.emulationAgent().setDeviceMetricsOverride(
+ var setDevicePromise = this._target.emulationAgent().setDeviceMetricsOverride(
overrideWidth, overrideHeight, this.settings.emulateResolution.get() ? this.settings.deviceScaleFactor.get() : 0,
this.settings.emulateMobile.get(), this._pageResizer ? false : this.settings.deviceFitWindow.get(), scale, 0, 0,
screenWidth, screenHeight, positionX, positionY, apiCallback.bind(this))
+ var allPromises = [ setDevicePromise ];
if (resetScrollAndPageScale)
- this._target.emulationAgent().resetScrollAndPageScaleFactor();
- return promise;
+ allPromises.push(this._target.emulationAgent().resetScrollAndPageScaleFactor());
+ return Promise.all(allPromises);
}
/**
* @this {WebInspector.OverridesSupport}
- * @return {!Promise.<undefined>}
+ * @return {!Promise.<?>}
*/
function clearDeviceMetricsOverride()
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698