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

Unified Diff: third_party/WebKit/LayoutTests/media/video-preload-override-cellular.html

Issue 1276143002: Defer media loading while on cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup. 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
Index: third_party/WebKit/LayoutTests/media/video-preload-override-cellular.html
diff --git a/third_party/WebKit/LayoutTests/media/video-preload-override-cellular.html b/third_party/WebKit/LayoutTests/media/video-preload-override-cellular.html
new file mode 100644
index 0000000000000000000000000000000000000000..7a7fd108e53b17040e91234797746f72df412906
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/video-preload-override-cellular.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<title>Tests that preload is overridden to none for cellular connections.</title>
+<style>
+/* Use a black background to see failures; the video clip is a white square. */
+body { background-color: black; }
+</style>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+function startTest() {
+ if (window.internals) {
+ internals.setNetworkStateNotifierTestOnly(true);
+ internals.setNetworkConnectionInfo('cellular', 2.0);
+ }
+
+ var video = document.querySelector('video');
+ video.addEventListener("suspend", function () {
+ if (window.internals)
+ internals.setNetworkStateNotifierTestOnly(false);
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+
+ video.src = "resources/test-positive-start-time.webm"
+}
+
+window.addEventListener('load', startTest, false);
+</script>
+<video preload="metadata"></video>

Powered by Google App Engine
This is Rietveld 408576698