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

Unified Diff: android_webview/test/shell/assets/full_screen_video.js

Issue 639923003: [aw] Fullscreen tests for non-media elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fullscreenNonMediaForReview
Patch Set: Add copyright notice to full_screen_video.js Created 6 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: android_webview/test/shell/assets/full_screen_video.js
diff --git a/android_webview/test/shell/assets/full_screen_video.js b/android_webview/test/shell/assets/full_screen_video.js
new file mode 100644
index 0000000000000000000000000000000000000000..2427171007545f7c94e902a6228a40ddfbca3b0c
--- /dev/null
+++ b/android_webview/test/shell/assets/full_screen_video.js
@@ -0,0 +1,27 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function goFullscreen(id) {
+ var element = document.getElementById(id);
+ if (element.webkitRequestFullScreen) {
+ element.webkitRequestFullScreen();
+ }
+}
+
+function playVideo() {
+ document.getElementById('video').play();
+}
+
+addEventListener('DOMContentLoaded', function() {
+ document.addEventListener('webkitfullscreenchange', function() {
+ javaOnEnterFullscreen.notifyJava();
+ }, false);
+ document.getElementById('video').addEventListener('play', function() {
+ javaOnPlayObserver.notifyJava();
+ }, false);
+ document.addEventListener('webkitfullscreenerror', function() {
+ javaFullScreenErrorObserver.notifyJava();
+ }, false);
+}, false);
+

Powered by Google App Engine
This is Rietveld 408576698