summaryrefslogtreecommitdiffstats
path: root/remoting/webapp
diff options
context:
space:
mode:
authorweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-05 05:41:20 +0000
committerweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-05 05:41:20 +0000
commite22a03ed78cef9b706db71165de8fe08873b9f24 (patch)
tree50010fb88d08eeb60b9a34ab50af63415202c266 /remoting/webapp
parent0a8a41f4ba32cba7102745e132675e5d3c7308e4 (diff)
downloadchromium_src-e22a03ed78cef9b706db71165de8fe08873b9f24.zip
chromium_src-e22a03ed78cef9b706db71165de8fe08873b9f24.tar.gz
chromium_src-e22a03ed78cef9b706db71165de8fe08873b9f24.tar.bz2
Add a Connect_Remote_Host test.
The test is very similar to Connect_Local_Host. I also made two changes in the webapp: 1. Added a helper to map a host name to the host id 2. Add an id to the host name cell in the host list for easy retrieval in the test. BUG=134210 Review URL: https://codereview.chromium.org/26055002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rw-r--r--remoting/webapp/host_list.js15
-rw-r--r--remoting/webapp/host_table_entry.js1
2 files changed, 16 insertions, 0 deletions
diff --git a/remoting/webapp/host_list.js b/remoting/webapp/host_list.js
index 7b24b3d..43ce092 100644
--- a/remoting/webapp/host_list.js
+++ b/remoting/webapp/host_list.js
@@ -141,6 +141,21 @@ remoting.HostList.prototype.getHostForId = function(hostId) {
};
/**
+ * Get the host id corresponding to the specified host name.
+ *
+ * @param {string} hostName The name of the host.
+ * @return {string?} The host id, if a host with the given name exists.
+ */
+remoting.HostList.prototype.getHostIdForName = function(hostName) {
+ for (var i = 0; i < this.hosts_.length; ++i) {
+ if (this.hosts_[i].hostName == hostName) {
+ return this.hosts_[i].hostId;
+ }
+ }
+ return null;
+};
+
+/**
* Query the Remoting Directory for the user's list of hosts.
*
* @param {function(boolean):void} onDone Callback invoked with true on success
diff --git a/remoting/webapp/host_table_entry.js b/remoting/webapp/host_table_entry.js
index fe9970b..779b4fc 100644
--- a/remoting/webapp/host_table_entry.js
+++ b/remoting/webapp/host_table_entry.js
@@ -72,6 +72,7 @@ remoting.HostTableEntry.prototype.createDom = function() {
// Create the host name cell.
var hostNameCell = /** @type {HTMLElement} */ document.createElement('div');
hostNameCell.classList.add('box-spacer');
+ hostNameCell.id = 'host_' + this.host.hostId;
tableRow.appendChild(hostNameCell);
// Create the host rename cell.
var editButton = /** @type {HTMLElement} */ document.createElement('span');