Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Unified Diff: LayoutTests/media/media-time-formatting.html

Issue 1360203002: Fix media element time display for times over an hour. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/layout/LayoutTheme.h » ('j') | Source/core/testing/InternalSettings.idl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/media-time-formatting.html
diff --git a/LayoutTests/media/media-time-formatting.html b/LayoutTests/media/media-time-formatting.html
new file mode 100644
index 0000000000000000000000000000000000000000..be24daa5755949daab62ba70e5484b4dd6323538
--- /dev/null
+++ b/LayoutTests/media/media-time-formatting.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=video-test.js></script>
+ <script>
+ function toSeconds(h,m,s)
+ {
+ return (h * 60 + m) * 60 + s;
+ }
+
+ function runOneSet()
+ {
+ var times = [
+ toSeconds(0,0,1),
+ toSeconds(0,0,15),
+ toSeconds(0,10,0),
+ toSeconds(1,0,0),
+ toSeconds(2,0,0)
+ ];
+
+ for(var timeIndex = 0; timeIndex < times.length; timeIndex++) {
+ var time = times[timeIndex];
+ for(var durationIndex = 0; durationIndex < times.length; durationIndex++) {
+ var duration = times[durationIndex];
+ if (!duration || duration >= time)
+ consoleWrite("duration: " + duration + " time: " + time + " formatted: "
+ + internals.formatChromiumMediaControlsTime(time,duration,false));
+ }
+ }
+ }
+
+ function doTest() {
+ internals.settings.setNewMediaPlaybackUiEnabled(false);
+ runOneSet();
+ internals.settings.setNewMediaPlaybackUiEnabled(true);
+ runOneSet();
+ endTest();
+ }
+ </script>
+</head>
+<body onload="doTest()">
+ <p>Test formatting of times for HTMLMediaElement.</p>
+</body>
+</html>
« no previous file with comments | « no previous file | Source/core/layout/LayoutTheme.h » ('j') | Source/core/testing/InternalSettings.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698