Commit fc5d8d1b authored by Eduardo's avatar Eduardo

Apply suggestions from code review

Co-authored-by: 's avatarRobert Knight <robertknight@gmail.com>
parent 35fc303b
...@@ -15,7 +15,7 @@ import { isMessageEqual } from './port-util'; ...@@ -15,7 +15,7 @@ import { isMessageEqual } from './port-util';
* frames. * frames.
* *
* There are 4 types of frames: * There are 4 types of frames:
* - `host`: frame where the hypothesis client is initially loaded. * - `host`: frame where the Hypothesis client is initially loaded.
* - `guest`: frames with annotatable content. In some instances a `guest` * - `guest`: frames with annotatable content. In some instances a `guest`
* frame can be the same as the `host` frame, in other cases, it is an iframe * frame can be the same as the `host` frame, in other cases, it is an iframe
* where either (1) the hypothesis client has been injected or (2) the * where either (1) the hypothesis client has been injected or (2) the
...@@ -33,7 +33,7 @@ import { isMessageEqual } from './port-util'; ...@@ -33,7 +33,7 @@ import { isMessageEqual } from './port-util';
* |-> `notebook` iframe * |-> `notebook` iframe
* |-> [`guest` iframes] * |-> [`guest` iframes]
* *
* Currently, we support the communication between the following pairs of frames: * Currently, we support communication between the following pairs of frames:
* - `guest-host` * - `guest-host`
* - `guest-sidebar` * - `guest-sidebar`
* - `host-sidebar` * - `host-sidebar`
...@@ -65,7 +65,7 @@ export class PortProvider { ...@@ -65,7 +65,7 @@ export class PortProvider {
/** /**
* @param {string} hypothesisAppsOrigin - the origin of the hypothesis apps * @param {string} hypothesisAppsOrigin - the origin of the hypothesis apps
* is use to send the notebook and sidebar ports to only the frames that * is use to send the notebook and sidebar ports to only the frames that
* matches the origin. * match the origin.
*/ */
constructor(hypothesisAppsOrigin) { constructor(hypothesisAppsOrigin) {
this._hypothesisAppsOrigin = hypothesisAppsOrigin; this._hypothesisAppsOrigin = hypothesisAppsOrigin;
......
...@@ -28,7 +28,7 @@ describe('PortFinder', () => { ...@@ -28,7 +28,7 @@ describe('PortFinder', () => {
}); });
describe('#destroy', () => { describe('#destroy', () => {
it('ignores `offer` messages of ports', async () => { it('ignores subsequent `offer` messages of ports', async () => {
let error; let error;
const channel = 'host-sidebar'; const channel = 'host-sidebar';
const port = 'sidebar'; const port = 'sidebar';
......
...@@ -208,7 +208,7 @@ describe('PortProvider', () => { ...@@ -208,7 +208,7 @@ describe('PortProvider', () => {
); );
}); });
it('responds to the first valid port request, ignore additional requests', async () => { it('responds to the first valid port request but ignores additional requests', async () => {
const data = { const data = {
channel: 'guest-host', channel: 'guest-host',
port: 'guest', port: 'guest',
......
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