Fixes a bug where touch device scripts were not cleared on exit of device mode in devtools.

When selecting more than 1 touch device during device mode in devtools, only
the touchevent scripts for the last selected device are cleared upon exiting
device mode. Events such as 'ontouchstart', coming from previous devices,
will persist.

BUG=133915
TEST=Reproduction steps are in https://crbug.com/133915#c46

Review URL: https://codereview.chromium.org/1313793005

git-svn-id: svn://svn.chromium.org/blink/trunk@201176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0879154d
......@@ -705,20 +705,18 @@ WebInspector.OverridesSupport.prototype = {
Object.defineProperty(recepients[j], touchEvents[i], { value: null, writable: true, configurable: true, enumerable: true });
}
}
}
};
var symbol = WebInspector.OverridesSupport._touchEventsScriptIdSymbol;
if (emulationEnabled && target[symbol] !== -1) {
target[symbol] = -1;
target.pageAgent().addScriptToEvaluateOnLoad("(" + injectedFunction.toString() + ")()", scriptAddedCallback);
} else {
if (typeof target[symbol] !== "undefined") {
target.pageAgent().removeScriptToEvaluateOnLoad(target[symbol]);
delete target[symbol];
}
if (typeof target[symbol] !== "undefined") {
target.pageAgent().removeScriptToEvaluateOnLoad(target[symbol]);
delete target[symbol];
}
if (emulationEnabled)
target.pageAgent().addScriptToEvaluateOnLoad("(" + injectedFunction.toString() + ")()", scriptAddedCallback);
/**
* @param {?Protocol.Error} error
* @param {string} scriptId
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment