Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
14de99cf
Commit
14de99cf
authored
May 22, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test
parent
9aa6e65a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
64 deletions
+1
-64
eventManager.js
src/lib/eventManager.js
+0
-64
smoke-test.js
test-browser/tests/smoke-test.js
+1
-0
No files found.
src/lib/eventManager.js
deleted
100644 → 0
View file @
9aa6e65a
'use strict'
function
eventManager
()
{
this
.
registered
=
{}
}
/*
* Unregister a listenner.
* Note that if obj is a function. the unregistration will be applied to the dummy obj {}.
*
* @param {String} eventName - the event name
* @param {Object or Func} obj - object that will listen on this event
* @param {Func} func - function of the listenners that will be executed
*/
eventManager
.
prototype
.
unregister
=
function
(
eventName
,
obj
,
func
)
{
if
(
obj
instanceof
Function
)
{
func
=
obj
obj
=
{}
}
for
(
var
reg
in
this
.
registered
[
eventName
])
{
if
(
this
.
registered
[
eventName
][
reg
]
&&
(
!
func
||
this
.
registered
[
eventName
][
reg
].
func
===
func
))
{
this
.
registered
[
eventName
].
splice
(
reg
,
1
)
return
}
}
}
/*
* Register a new listenner.
* Note that if obj is a function, the function registration will be associated with the dummy object {}
*
* @param {String} eventName - the event name
* @param {Object or Func} obj - object that will listen on this event
* @param {Func} func - function of the listenners that will be executed
*/
eventManager
.
prototype
.
register
=
function
(
eventName
,
obj
,
func
)
{
if
(
!
this
.
registered
[
eventName
])
{
this
.
registered
[
eventName
]
=
[]
}
if
(
obj
instanceof
Function
)
{
func
=
obj
obj
=
{}
}
this
.
registered
[
eventName
].
push
({
obj
:
obj
,
func
:
func
})
}
/*
* trigger event.
* Every listenner have their associated function executed
*
* @param {String} eventName - the event name
* @param {Array}j - argument that will be passed to the exectued function.
*/
eventManager
.
prototype
.
trigger
=
function
(
eventName
,
args
)
{
for
(
var
listener
in
this
.
registered
[
eventName
])
{
var
l
=
this
.
registered
[
eventName
][
listener
]
l
.
func
.
apply
(
l
.
obj
,
args
)
}
}
module
.
exports
=
eventManager
test-browser/tests/smoke-test.js
View file @
14de99cf
...
@@ -10,6 +10,7 @@ module.exports = {
...
@@ -10,6 +10,7 @@ module.exports = {
'Smoke test'
:
function
(
browser
)
{
'Smoke test'
:
function
(
browser
)
{
browser
browser
.
waitForElementVisible
(
'#righthand-panel'
,
10000
)
.
waitForElementVisible
(
'#righthand-panel'
,
10000
)
.
click
(
'.settingsView'
)
.
assert
.
containsText
(
'#righthand-panel'
,
'Solidity version'
)
.
assert
.
containsText
(
'#righthand-panel'
,
'Solidity version'
)
.
end
()
.
end
()
},
},
...
...
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