<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199220] trunk/Websites/perf.webkit.org</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199220">199220</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2016-04-08 00:15:43 -0700 (Fri, 08 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix various bugs in the new syncing script
https://bugs.webkit.org/show_bug.cgi?id=156393

Reviewed by Darin Adler.

* server-tests/resources/common-operations.js: Added. This file was supposed to be added in <a href="http://trac.webkit.org/projects/webkit/changeset/199191">r199191</a>.
(addBuilderForReport):
(addSlaveForReport):
(connectToDatabaseInEveryTest):
(submitReport):
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
builder as this dramatically increases the amount of log we generate.
* tools/js/parse-arguments.js:
(parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
* tools/js/remote.js:
(RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
(RemoteAPI.prototype.configure): Added more validations with nice error messages.
(RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
the right port in configure instead based on the scheme.
* tools/sync-buildbot.js:
(syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
properly in Manifest.fetch() because we do need to &quot;forget&quot; about some tests and platforms in some cases.
For now, delete all v3 model objects and start over in each syncing cycle.
* unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgChangeLog">trunk/Websites/perf.webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsitesperfwebkitorgtoolsjsbuildbottriggerablejs">trunk/Websites/perf.webkit.org/tools/js/buildbot-triggerable.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgtoolsjsparseargumentsjs">trunk/Websites/perf.webkit.org/tools/js/parse-arguments.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgtoolsjsremotejs">trunk/Websites/perf.webkit.org/tools/js/remote.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgtoolssyncbuildbotjs">trunk/Websites/perf.webkit.org/tools/sync-buildbot.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgservertestsresourcescommonoperationsjs">trunk/Websites/perf.webkit.org/server-tests/resources/common-operations.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgunitteststoolsjsremotetestsjs">trunk/Websites/perf.webkit.org/unit-tests/tools-js-remote-tests.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebsitesperfwebkitorgChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/ChangeLog (199219 => 199220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/ChangeLog        2016-04-08 07:13:28 UTC (rev 199219)
+++ trunk/Websites/perf.webkit.org/ChangeLog        2016-04-08 07:15:43 UTC (rev 199220)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-04-08  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        Fix various bugs in the new syncing script
+        https://bugs.webkit.org/show_bug.cgi?id=156393
+
+        Reviewed by Darin Adler.
+
+        * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
+        (addBuilderForReport):
+        (addSlaveForReport):
+        (connectToDatabaseInEveryTest):
+        (submitReport):
+        * tools/js/buildbot-triggerable.js:
+        (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
+        builder as this dramatically increases the amount of log we generate.
+        * tools/js/parse-arguments.js:
+        (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
+        * tools/js/remote.js:
+        (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
+        (RemoteAPI.prototype.configure): Added more validations with nice error messages.
+        (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
+        the right port in configure instead based on the scheme.
+        * tools/sync-buildbot.js:
+        (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
+        and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
+        properly in Manifest.fetch() because we do need to &quot;forget&quot; about some tests and platforms in some cases.
+        For now, delete all v3 model objects and start over in each syncing cycle.
+        * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
+
</ins><span class="cx"> 2016-04-07  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         sync-buildbot.js doesn't mark disappeared builds as failed
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgservertestsresourcescommonoperationsjs"></a>
<div class="addfile"><h4>Added: trunk/Websites/perf.webkit.org/server-tests/resources/common-operations.js (0 => 199220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/server-tests/resources/common-operations.js                                (rev 0)
+++ trunk/Websites/perf.webkit.org/server-tests/resources/common-operations.js        2016-04-08 07:15:43 UTC (rev 199220)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+
+const crypto = require('crypto');
+
+function addBuilderForReport(report)
+{
+    return TestServer.database().insert('builders', {
+        name: report.builderName,
+        password_hash: crypto.createHash('sha256').update(report.builderPassword).digest('hex')
+    });
+}
+
+function addSlaveForReport(report)
+{
+    return TestServer.database().insert('build_slaves', {
+        name: report.slaveName,
+        password_hash: crypto.createHash('sha256').update(report.slavePassword).digest('hex')
+    });
+}
+
+function connectToDatabaseInEveryTest()
+{
+    beforeEach(function () {
+        TestServer.database().connect({keepAlive: true});
+    });
+
+    afterEach(function () {
+        TestServer.database().disconnect();
+    });
+}
+
+function submitReport(report)
+{
+    return TestServer.database().insert('builders', {
+        name: report[0].builderName,
+        password_hash: crypto.createHash('sha256').update(report[0].builderPassword).digest('hex')
+    }).then(function () {
+        return TestServer.remoteAPI().postJSON('/api/report/', report);
+    });
+}
+
+if (typeof module != 'undefined') {
+    module.exports.addBuilderForReport = addBuilderForReport;
+    module.exports.addSlaveForReport = addSlaveForReport;
+    module.exports.connectToDatabaseInEveryTest = connectToDatabaseInEveryTest;
+    module.exports.submitReport = submitReport;
+}
</ins></span></pre></div>
<a id="trunkWebsitesperfwebkitorgtoolsjsbuildbottriggerablejs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/tools/js/buildbot-triggerable.js (199219 => 199220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/tools/js/buildbot-triggerable.js        2016-04-08 07:13:28 UTC (rev 199219)
+++ trunk/Websites/perf.webkit.org/tools/js/buildbot-triggerable.js        2016-04-08 07:15:43 UTC (rev 199220)
</span><span class="lines">@@ -83,7 +83,6 @@
</span><span class="cx">         let associatedRequests = new Set;
</span><span class="cx">         let self = this;
</span><span class="cx">         return Promise.all(this._syncers.map(function (syncer) {
</span><del>-            self._logger.log(`Fetching builds on ${syncer.builderName()}`);
</del><span class="cx">             return syncer.pullBuildbot(self._lookbackCount).then(function (entryList) {
</span><span class="cx">                 for (let entry of entryList) {
</span><span class="cx">                     let request = BuildRequest.findById(entry.buildRequestId());
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgtoolsjsparseargumentsjs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/tools/js/parse-arguments.js (199219 => 199220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/tools/js/parse-arguments.js        2016-04-08 07:13:28 UTC (rev 199219)
+++ trunk/Websites/perf.webkit.org/tools/js/parse-arguments.js        2016-04-08 07:15:43 UTC (rev 199220)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><del>-function parseArgument(argv, acceptedOptions) {
</del><ins>+function parseArguments(argv, acceptedOptions) {
</ins><span class="cx">     var args = argv.slice(2);
</span><span class="cx">     var options = {}
</span><span class="cx">     for (var i = 0; i &lt; args.length; i += 2) {
</span><span class="lines">@@ -31,4 +31,4 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if (typeof module != 'undefined')
</span><del>-    module.exports.parseArgument = parseArgument;
</del><ins>+    module.exports.parseArguments = parseArguments;
</ins></span></pre></div>
<a id="trunkWebsitesperfwebkitorgtoolsjsremotejs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/tools/js/remote.js (199219 => 199220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/tools/js/remote.js        2016-04-08 07:13:28 UTC (rev 199219)
+++ trunk/Websites/perf.webkit.org/tools/js/remote.js        2016-04-08 07:15:43 UTC (rev 199220)
</span><span class="lines">@@ -17,19 +17,37 @@
</span><span class="cx">     {
</span><span class="cx">         let scheme = this._server.scheme;
</span><span class="cx">         let port = this._server.port;
</span><del>-        let portSuffix = (scheme == 'http' &amp;&amp; port == 80) || (scheme == 'https' &amp;&amp; port == 443) ? '' : `:${port}`;
</del><ins>+        let portSuffix = this._server.port == this._server.defaultPort ? '' : `:${port}`;
</ins><span class="cx">         if (path.charAt(0) != '/')
</span><span class="cx">             path = '/' + path;
</span><del>-        return `${scheme}://${this._server.host}portSuffix${path}`;
</del><ins>+        return `${scheme}://${this._server.host}${portSuffix}${path}`;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     configure(server)
</span><span class="cx">     {
</span><span class="cx">         assert(server.scheme === 'http' || server.scheme === 'https');
</span><del>-        assert.equal(typeof(server.host), 'string');
-        assert(!server.port || typeof(server.port) == 'number');
-        assert(!server.auth || typeof(server.auth) == 'object');
-        this._server = server;
</del><ins>+        assert.equal(typeof(server.host), 'string', 'host should be a string');
+        assert(!server.port || typeof(server.port) == 'number', 'port should be a number');
+
+        let auth = null;
+        if (server.auth) {
+            assert.equal(typeof(server.auth), 'object', 'auth should be a dictionary with username and password as keys');
+            assert.equal(typeof(server.auth.username), 'string', 'auth should contain a string username');
+            assert.equal(typeof(server.auth.password), 'string', 'auth should contain a string password');
+            auth = {
+                username: server.auth.username,
+                password: server.auth.password,
+            };
+        }
+
+        const defaultPort = server.scheme == 'http' ? 80 : 443;
+        this._server = {
+            scheme: server.scheme,
+            host: server.host,
+            port: server.port || defaultPort,
+            defaultPort: defaultPort,
+            auth: auth,
+        };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     getJSON(path)
</span><span class="lines">@@ -72,7 +90,7 @@
</span><span class="cx">         return new Promise(function (resolve, reject) {
</span><span class="cx">             let options = {
</span><span class="cx">                 hostname: server.host,
</span><del>-                port: server.port || 80,
</del><ins>+                port: server.port,
</ins><span class="cx">                 auth: server.auth ? server.auth.username + ':' + server.auth.password : null,
</span><span class="cx">                 method: method,
</span><span class="cx">                 path: path,
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgtoolssyncbuildbotjs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/tools/sync-buildbot.js (199219 => 199220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/tools/sync-buildbot.js        2016-04-08 07:13:28 UTC (rev 199219)
+++ trunk/Websites/perf.webkit.org/tools/sync-buildbot.js        2016-04-08 07:15:43 UTC (rev 199220)
</span><span class="lines">@@ -21,6 +21,18 @@
</span><span class="cx"> 
</span><span class="cx"> function syncLoop(options)
</span><span class="cx"> {
</span><ins>+    // FIXME: Fix Manifest.fetch() to use ensureSingleton to create model objects.
+    global.AnalysisTask._fetchAllPromise = null;
+    global.AnalysisTask.clearStaticMap();
+    global.BuildRequest.clearStaticMap();
+    global.CommitLog.clearStaticMap();
+    global.Metric.clearStaticMap();
+    global.Platform.clearStaticMap();
+    global.Repository.clearStaticMap();
+    global.RootSet.clearStaticMap();
+    global.Test.clearStaticMap();
+    global.TestGroup.clearStaticMap();
+
</ins><span class="cx">     let serverConfig = JSON.parse(fs.readFileSync(options['--server-config-json'], 'utf8'));
</span><span class="cx">     let buildbotConfig = JSON.parse(fs.readFileSync(options['--buildbot-config-json'], 'utf8'));
</span><span class="cx">     let buildbotRemote = new RemoteAPI(buildbotConfig.server);
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgunitteststoolsjsremotetestsjs"></a>
<div class="addfile"><h4>Added: trunk/Websites/perf.webkit.org/unit-tests/tools-js-remote-tests.js (0 => 199220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/unit-tests/tools-js-remote-tests.js                                (rev 0)
+++ trunk/Websites/perf.webkit.org/unit-tests/tools-js-remote-tests.js        2016-04-08 07:15:43 UTC (rev 199220)
</span><span class="lines">@@ -0,0 +1,112 @@
</span><ins>+'use strict';
+
+const assert = require('assert');
+
+const RemoteAPI = require('../tools/js/remote.js').RemoteAPI;
+
+describe('RemoteAPI', function () {
+    describe('configure', function () {
+        it('should accept a valid configuration', function () {
+            let remote = new RemoteAPI();
+            assert.doesNotThrow(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80}); });
+        });
+
+        it('should reject a scheme other than http and https', function () {
+            let remote = new RemoteAPI();
+            assert.doesNotThrow(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80}); });
+            assert.doesNotThrow(function () { remote.configure({scheme: 'https', host: 'build.webkit.org', port: 9999}); });
+            assert.throws(function () { remote.configure({scheme: 'ftp', host: 'build.webkit.org', port: 9999}); });
+        });
+
+        it('should accept a configuration without port', function () {
+            let remote = new RemoteAPI();
+            assert.doesNotThrow(function () { remote.configure({scheme: 'http', host: 'build.webkit.org'}); });
+        });
+
+        it('should reject non-string value for scheme', function () {
+            let remote = new RemoteAPI();
+            assert.throws(function () { remote.configure({scheme: 1, host: 'build.webkit.org', port: 80}); });
+            assert.throws(function () { remote.configure({scheme: {}, host: 'build.webkit.org', port: 80}); });
+            assert.throws(function () { remote.configure({scheme: [], host: 'build.webkit.org', port: 80}); });
+        });
+
+        it('should reject non-string value for host', function () {
+            let remote = new RemoteAPI();
+            assert.throws(function () { remote.configure({scheme: 'http', host: 1, port: 80}); });
+            assert.throws(function () { remote.configure({scheme: 'http', host: {}, port: 80}); });
+            assert.throws(function () { remote.configure({scheme: 'http', host: [], port: 80}); });
+        });
+
+        it('should reject non-object value for auth', function () {
+            let remote = new RemoteAPI();
+            assert.throws(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80, auth: 'a'}); });
+            assert.throws(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80, auth: 1}); });
+        });
+
+        it('should accept a configuration with auth', function () {
+            let remote = new RemoteAPI();
+            assert.doesNotThrow(function () {
+                remote.configure({
+                    scheme: 'http',
+                    host: 'build.webkit.org',
+                    port: 80,
+                    auth: {
+                        'username': 'a',
+                        'password': 'b',
+                    },
+                });
+            });
+        });
+
+        it('should reject auth without username or password or when either is not a string', function () {
+            let remote = new RemoteAPI();
+            assert.throws(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80, auth: {}}); });
+            assert.throws(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80, auth: {username: 'a'}}); });
+            assert.throws(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80, auth: {password: 'b'}}); });
+            assert.throws(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80, auth: {username: 1, password: 'a'}}); });
+            assert.throws(function () { remote.configure({scheme: 'http', host: 'build.webkit.org', port: 80, auth: {username: 'a', password: 1}}); });
+        });
+    });
+
+    describe('url', function () {
+        it('should be able to serialize http://build.webkit.org', function () {
+            let remote = new RemoteAPI({scheme: 'http', host: 'build.webkit.org', port: 80});
+            assert.equal(remote.url('/json/builders'), 'http://build.webkit.org/json/builders');
+        });
+
+        it('should be able to serialize http://build.webkit.org when port is not specified', function () {
+            let remote = new RemoteAPI({scheme: 'http', host: 'build.webkit.org'});
+            assert.equal(remote.url('/json/builders'), 'http://build.webkit.org/json/builders');
+        });
+
+        it('should be able to serialize https://build.webkit.org when port is 80', function () {
+            let remote = new RemoteAPI({scheme: 'http', host: 'build.webkit.org', port: 80});
+            assert.equal(remote.url('/json/builders'), 'http://build.webkit.org/json/builders');
+        });
+
+        it('should be able to serialize http://build.webkit.org:8080', function () {
+            let remote = new RemoteAPI({scheme: 'http', host: 'build.webkit.org', port: 8080});
+            assert.equal(remote.url('/json/builders'), 'http://build.webkit.org:8080/json/builders');
+        });
+
+        it('should be able to serialize https://build.webkit.org when port is not specified', function () {
+            let remote = new RemoteAPI({scheme: 'https', host: 'build.webkit.org'});
+            assert.equal(remote.url('/json/builders'), 'https://build.webkit.org/json/builders');
+        });
+
+        it('should be able to serialize https://build.webkit.org when port is 443', function () {
+            let remote = new RemoteAPI({scheme: 'https', host: 'build.webkit.org', port: 443});
+            assert.equal(remote.url('/json/builders'), 'https://build.webkit.org/json/builders');
+        });
+
+        it('should be able to serialize https://build.webkit.org:8443', function () {
+            let remote = new RemoteAPI({scheme: 'https', host: 'build.webkit.org', port: 8443});
+            assert.equal(remote.url('/json/builders'), 'https://build.webkit.org:8443/json/builders');
+        });
+
+        it('should automatically prefix the path with /', function () {
+            let remote = new RemoteAPI({scheme: 'http', host: 'build.webkit.org'});
+            assert.equal(remote.url('json/builders'), 'http://build.webkit.org/json/builders');
+        });
+    });
+});
</ins></span></pre>
</div>
</div>

</body>
</html>