-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor AMFlowClient #13
Conversation
.then(() => { | ||
activeAMFlow.open(playId); | ||
passiveAMFlow.open(playId); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上ですでに open していたので無駄な呼び出しでした。
@@ -422,6 +427,91 @@ describe("AMFlow の動作テスト", () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
it("AMFlow#onEvent が登録されるより以前の Event を正しく取得できる", done => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主変更 1. のテストです。
@@ -248,6 +249,7 @@ describe("run-test", () => { | |||
if (err) { | |||
assert.equal(err instanceof Error, true); | |||
assert.equal(permission == null, true); | |||
assert.strictEqual(err.name, "InvalidStatus"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主変更 2. のテストです。
.then(() => { | ||
return new Promise((resolve, reject) => { | ||
// すでに stop したプレーの AMFlowClient に対して close() を呼び出しても問題ない | ||
passiveAMFlow.close(err => (err ? reject(err) : resolve())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主変更 3. のテストです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメント加えましたが approved.
if (!this.store.isDestroyed()) { | ||
this.store.sendEventTrigger.remove(this.onEventSended, this); | ||
this.store.sendTickTrigger.remove(this.onTickSended, this); | ||
} | ||
this.store = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
どうせなので unconsumedEvents
も捨てませんか。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
53500e3 対応しました。
このPullRequestが解決する内容
AMFlowClient をリファクタリングします。
Error#name
を定義に合わせるAMFlowClient#close()
を呼んだ際にエラーが発生していた件の修正