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

Unified Diff: third_party/WebKit/LayoutTests/media/video-preload-cellular-test.js

Issue 1381613003: Defer media loading while on cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 2 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
Index: third_party/WebKit/LayoutTests/media/video-preload-cellular-test.js
diff --git a/third_party/WebKit/LayoutTests/media/video-preload-cellular-test.js b/third_party/WebKit/LayoutTests/media/video-preload-cellular-test.js
new file mode 100644
index 0000000000000000000000000000000000000000..08c7654ec3bf01ace95a434faa29317324450067
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/video-preload-cellular-test.js
@@ -0,0 +1,17 @@
+function CellularPreloadTest(preloadType) {
philipj_slow 2015/10/21 11:11:29 LayoutTests/media/video-controls-fullscreen.js sho
DaleCurtis 2015/10/21 22:34:32 lowercase_for_the_win().
+ return function(t) {
+ internals.setNetworkStateNotifierTestOnly(true);
+ internals.setNetworkConnectionInfo('cellular', 2.0);
+
+ var video = document.createElement('video');
+ if (preloadType)
+ video.preload = preloadType;
philipj_slow 2015/10/21 11:11:29 After this line, can you also assert_equals(video.
DaleCurtis 2015/10/21 22:34:32 Done.
+ video.src = 'resources/test-positive-start-time.webm';
+
+ video.onsuspend = t.step_func_done();
+ video.onprogress = t.unreached_func();
+ t.add_cleanup(function() {
+ internals.setNetworkStateNotifierTestOnly(false);
+ });
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698