Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
b23e16ed
Commit
b23e16ed
authored
Feb 02, 2015
by
Aron Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub out the tests for CrossFrameDiscovery
parent
c34b965a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
cross-frame-discovery-test.coffee
tests/js/cross-frame-discovery-test.coffee
+41
-0
No files found.
tests/js/cross-frame-discovery-test.coffee
0 → 100644
View file @
b23e16ed
assert
=
chai
.
assert
sinon
.
assert
.
expose
assert
,
prefix
:
null
describe
'CrossFrameDiscovery'
,
->
sandbox
=
sinon
.
sandbox
.
create
()
fakeWindow
=
null
createDiscovery
=
null
beforeEach
module
(
'h'
)
beforeEach
inject
(
CrossFrameDiscovery
)
->
fakeWindow
=
{
top
:
null
addEventListener
:
sandbox
.
stub
()
removeEventListener
:
sandbox
.
stub
()
}
createBridge
=
(
options
)
->
new
CrossFrameDiscovery
(
fakeWindow
,
options
)
afterEach
->
sandbox
.
restore
()
describe
'startDiscovery'
,
->
it
'adds a "message" listener to the window object'
describe
'when acting as a server (options.server = true)'
,
->
it
'sends out a "discovery" message to every frame'
it
'does not send the message to itself'
it
'sends an "ack" on receiving a "request"'
it
'calls the discovery callback on receiving "request"'
describe
'when acting as a client (options.client = false)'
,
->
it
'sends out a discovery message to every frame'
it
'does not send the message to itself'
it
'sends a "request" in response to an "offer"'
it
'does not respond to an "offer" if a "request" is already in progress'
it
'allows responding to a "request" once a previous "request" has completed'
it
'calls the discovery callback on receiving an "ack"'
describe
'stopDiscovery'
,
->
it
'removes the "message" listener from the window'
it
'allows startDiscovery to be called with a new handler'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment