Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1196987: Update UUID returned to be a valid UUID 4; r=jgriffin
Browse files Browse the repository at this point in the history
Currently the UUID returns the `{}` which is not valid and breaks
URI Templates used in WebDriver languages
  • Loading branch information
David Burns committed Aug 24, 2015
1 parent 197f17d commit 7a367dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,7 @@ def test_we_pass_in_required_capability_we_cant_fulfil_raises_exception(self):
# Start a new session just to make sure we leave the browser in the
# same state it was before it started the test
self.marionette.start_session()

def test_we_get_valid_uuid_4_when_creating_a_session(self):
self.assertNotIn("{", self.marionette.session_id, 'Session ID has {} in it. %s ' \
% self.marionette.session_id)
3 changes: 2 additions & 1 deletion testing/marionette/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,10 @@ 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 ||
uuidGen.generateUUID().toString();
uuid.substring(1, uuid.length - 1);

this.newSessionCommandId = cmd.id;
this.setSessionCapabilities(cmd.parameters.capabilities);
Expand Down

0 comments on commit 7a367dd

Please sign in to comment.