mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 14:25:49 +00:00
Bug 1198797 - Centralise creation of UUIDs in Marionette; r=ato
--HG-- extra : commitid : Ea8vtP8SvRy extra : rebase_source : e08e8708ea9f3f3de5bbee56ac7809efcf924e52
This commit is contained in:
parent
ef0b0e075e
commit
c13a8ae6ec
@ -48,7 +48,6 @@ const CLICK_TO_START_PREF = "marionette.debugging.clicktostart";
|
||||
const CONTENT_LISTENER_PREF = "marionette.contentListener";
|
||||
|
||||
const logger = Log.repository.getLogger("Marionette");
|
||||
const uuidGen = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
|
||||
const globalMessageManager = Cc["@mozilla.org/globalmessagemanager;1"]
|
||||
.getService(Ci.nsIMessageBroadcaster);
|
||||
|
||||
@ -510,10 +509,9 @@ GeckoDriver.prototype.listeningPromise = function() {
|
||||
|
||||
/** Create a new session. */
|
||||
GeckoDriver.prototype.newSession = function(cmd, resp) {
|
||||
let uuid = uuidGen.generateUUID().toString();
|
||||
this.sessionId = cmd.parameters.sessionId ||
|
||||
cmd.parameters.session_id ||
|
||||
uuid.substring(1, uuid.length - 1);
|
||||
elements.generateUUID();
|
||||
|
||||
this.newSessionCommandId = cmd.id;
|
||||
this.setSessionCapabilities(cmd.parameters.capabilities);
|
||||
|
@ -22,6 +22,7 @@ XPCOMUtils.defineLazyModuleGetter(this, 'clearInterval',
|
||||
|
||||
this.EXPORTED_SYMBOLS = [
|
||||
"Accessibility",
|
||||
"elements",
|
||||
"ElementManager",
|
||||
"CLASS_NAME",
|
||||
"SELECTOR",
|
||||
@ -280,8 +281,7 @@ ElementManager.prototype = {
|
||||
delete this.seenItems[i];
|
||||
}
|
||||
}
|
||||
let uuid = uuidGen.generateUUID().toString();
|
||||
let id = uuid.substring(1, uuid.length - 1);
|
||||
let id = elements.generateUUID();
|
||||
this.seenItems[id] = Components.utils.getWeakReference(element);
|
||||
return id;
|
||||
},
|
||||
@ -754,3 +754,9 @@ ElementManager.prototype = {
|
||||
return elements;
|
||||
},
|
||||
}
|
||||
|
||||
this.elements = {};
|
||||
elements.generateUUID = function() {
|
||||
let uuid = uuidGen.generateUUID().toString();
|
||||
return uuid.substring(1, uuid.length - 1);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user