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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/media_access/media_check_guest.html

Issue 573183002: Add WebView browser test for MediaStreamTrack.getSources and CheckMediaAccessPermisson. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@render_frame_get_sources_rfhd
Patch Set: Code review. Created 6 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 | « chrome/test/data/extensions/platform_apps/web_view/media_access/media_access_guest.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/platform_apps/web_view/media_access/media_check_guest.html
diff --git a/chrome/test/data/extensions/platform_apps/web_view/media_access/media_check_guest.html b/chrome/test/data/extensions/platform_apps/web_view/media_access/media_check_guest.html
new file mode 100644
index 0000000000000000000000000000000000000000..07164c0df4b991302d9dbd2a0cd18df8000b150b
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/web_view/media_access/media_check_guest.html
@@ -0,0 +1,47 @@
+<!--
+ * Copyright 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.
+-->
+<html>
+ <head>
+ <script type="text/javascript">
+ // A guest that requests media sources, which in turn checks for media
+ // access permission.
+ // Notifies the embedder when done via post message. Note that the
+ // embedder has to initiate a postMessage first so that guest has a
+ // reference to the embedder's window.
+
+ // The window reference of the embedder to send post message reply.
+ var embedderWindowChannel = null;
+
+ var notifyEmbedder = function(msg) {
+ embedderWindowChannel.postMessage(msg, '*');
+ };
+
+ var onSourceInfo = function(sources) {
+ notifyEmbedder(JSON.stringify(['got-sources']));
+ };
+ var startTest = function() {
+ MediaStreamTrack.getSources(onSourceInfo);
+ };
+ var onPostMessageReceived = function(e) {
+ var data = JSON.parse(e.data);
+ var testName = data[0];
+ if (testName == 'get-sources-permission') {
+ embedderWindowChannel = e.source;
+
+ // Start the test once we have |embedderWindowChannel|.
+ startTest();
+ }
+ };
+ window.addEventListener('message', onPostMessageReceived, false);
+ </script>
+ </head>
+ <body>
+ <div>
+ This is a guest requests media sources, which will check for media
+ access permission.
+ </div>
+ </body>
+</html>
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/media_access/media_access_guest.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698