Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
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
edx
edx-platform
Commits
afec2dd4
Commit
afec2dd4
authored
Dec 23, 2013
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for Android.
parent
b6808d3d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
50 deletions
+63
-50
common/lib/xmodule/xmodule/js/spec/video/video_control_spec.js
+29
-23
common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js
+23
-16
common/lib/xmodule/xmodule/js/spec/video/video_progress_slider_spec.js
+6
-5
common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js
+5
-6
No files found.
common/lib/xmodule/xmodule/js/spec/video/video_control_spec.js
View file @
afec2dd4
...
...
@@ -211,6 +211,11 @@
isTouch
:
[
'iPad'
]
},
{
name
:
'Android'
,
isShown
:
true
,
isTouch
:
[
'Android'
]
},
{
name
:
'iPhone'
,
isShown
:
false
,
isTouch
:
[
'iPhone'
]
...
...
@@ -237,38 +242,39 @@
});
});
it
(
'is shown on paused video on iPad in HTML5 player'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
'iPad'
]);
initialize
();
var
btnPlay
=
state
.
el
.
find
(
'.btn-play'
);
$
.
each
([
'iPad'
,
'Android'
],
function
(
index
,
device
)
{
it
(
'is shown on paused video on '
+
device
+
' in HTML5 player'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
device
]);
initialize
();
var
btnPlay
=
state
.
el
.
find
(
'.btn-play'
);
videoControl
.
play
();
videoControl
.
pause
();
videoControl
.
play
();
videoControl
.
pause
();
expect
(
btnPlay
).
not
.
toHaveClass
(
'is-hidden'
);
});
expect
(
btnPlay
).
not
.
toHaveClass
(
'is-hidden'
);
});
it
(
'is hidden on playing video on iPad
in HTML5 player'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
'iPad'
]);
initialize
();
var
btnPlay
=
state
.
el
.
find
(
'.btn-play'
);
it
(
'is hidden on playing video on '
+
device
+
'
in HTML5 player'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
device
]);
initialize
();
var
btnPlay
=
state
.
el
.
find
(
'.btn-play'
);
videoControl
.
play
();
videoControl
.
play
();
expect
(
btnPlay
).
toHaveClass
(
'is-hidden'
);
});
expect
(
btnPlay
).
toHaveClass
(
'is-hidden'
);
});
it
(
'is hidden on paused video on iPad
in YouTube player'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
'iPad'
]);
initializeYouTube
();
var
btnPlay
=
state
.
el
.
find
(
'.btn-play'
);
it
(
'is hidden on paused video on '
+
device
+
'
in YouTube player'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
device
]);
initializeYouTube
();
var
btnPlay
=
state
.
el
.
find
(
'.btn-play'
);
videoControl
.
play
();
videoControl
.
pause
();
videoControl
.
play
();
videoControl
.
pause
();
expect
(
btnPlay
).
toHaveClass
(
'is-hidden'
);
expect
(
btnPlay
).
toHaveClass
(
'is-hidden'
);
});
});
});
it
(
'show'
,
function
()
{
...
...
common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js
View file @
afec2dd4
...
...
@@ -157,14 +157,13 @@
// JS.
describe
(
'when on a touch based device'
,
function
()
{
beforeEach
(
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
'iPad'
]);
initialize
();
});
it
(
'create video volume control'
,
function
()
{
expect
(
videoVolumeControl
).
toBeUndefined
();
expect
(
state
.
el
.
find
(
'div.volume'
)).
not
.
toExist
();
$
.
each
([
'iPad'
,
'Android'
],
function
(
index
,
device
)
{
it
(
'create video volume control on'
+
device
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
device
]);
initialize
();
expect
(
videoVolumeControl
).
toBeUndefined
();
expect
(
state
.
el
.
find
(
'div.volume'
)).
not
.
toExist
();
});
});
});
...
...
@@ -879,10 +878,12 @@
describe
(
'on Touch devices'
,
function
()
{
it
(
'`is-touch` class name is added to container'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
'iPad'
]);
initialize
();
$
.
each
([
'iPad'
,
'Android'
,
'iPhone'
],
function
(
index
,
device
)
{
window
.
onTouchBasedDevice
.
andReturn
([
device
]);
initialize
();
expect
(
state
.
el
).
toHaveClass
(
'is-touch'
);
expect
(
state
.
el
).
toHaveClass
(
'is-touch'
);
});
});
it
(
'modules are not initialized on iPhone'
,
function
()
{
...
...
@@ -899,11 +900,17 @@
});
});
it
(
'controls become visible after playing starts on iPad'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
'iPad'
]);
initialize
();
$
.
each
([
'iPad'
,
'Android'
],
function
(
index
,
device
)
{
var
message
=
'controls become visible after playing starts on '
+
device
;
it
(
message
,
function
()
{
var
controls
;
window
.
onTouchBasedDevice
.
andReturn
([
device
]);
var
controls
=
state
.
el
.
find
(
'.video-controls'
);
runs
(
function
()
{
initialize
();
controls
=
state
.
el
.
find
(
'.video-controls'
);
});
waitsFor
(
function
()
{
return
state
.
el
.
hasClass
(
'is-initialized'
);
...
...
@@ -921,7 +928,7 @@
runs
(
function
()
{
expect
(
controls
).
not
.
toHaveClass
(
'is-hidden'
);
});
});
});
});
});
...
...
common/lib/xmodule/xmodule/js/spec/video/video_progress_slider_spec.js
View file @
afec2dd4
...
...
@@ -54,11 +54,12 @@
// We can't expect $.fn.slider not to have been called,
// because sliders are used in other parts of Video.
});
it
(
'build the slider on iPad'
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
'iPad'
]);
initialize
();
expect
(
videoProgressSlider
.
slider
).
toBeDefined
();
$
.
each
([
'iPad'
,
'Android'
],
function
(
index
,
device
)
{
it
(
'build the slider on '
+
device
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
device
]);
initialize
();
expect
(
videoProgressSlider
.
slider
).
toBeDefined
();
});
});
});
});
...
...
common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js
View file @
afec2dd4
...
...
@@ -57,13 +57,12 @@
});
describe
(
'when running on touch based device'
,
function
()
{
beforeEach
(
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
'iPad'
]);
initialize
();
});
it
(
'is not rendered'
,
function
()
{
$
.
each
([
'iPad'
,
'Android'
],
function
(
index
,
device
)
{
it
(
'is not rendered on'
+
device
,
function
()
{
window
.
onTouchBasedDevice
.
andReturn
([
device
]);
initialize
();
expect
(
state
.
el
.
find
(
'div.speeds'
)).
not
.
toExist
();
});
});
});
...
...
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