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

Side by Side Diff: third_party/WebKit/LayoutTests/presentation/presentation-receiver.html

Issue 2500273003: Presentation API: add settings for presentation.receiver being exposed. (Closed)
Patch Set: update property-access-tests and rebase Created 4 years 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../resources/testharness.js"></script> 4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script> 5 <script src="../resources/testharnessreport.js"></script>
6 <script> 6 <script>
7 7
8 test(function() { 8 test(t => {
9 assert_true('receiver' in navigator.presentation); 9 assert_true('receiver' in navigator.presentation);
10 assert_true('connectionList' in navigator.presentation.receiver); 10 }, "Test that presentation.receiver is present.")
11 }, "Test that the Presentation Receiver API is present.")
12 11
13 test(function() { 12 test(t => {
13 assert_equals(navigator.presentation.receiver, null);
14 }, "Test that presentation.receiver returns null when the setting is not set.");
15
16 test(t => {
17 internals.settings.setPresentationReceiver(true);
18 t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); });
19
20 assert_not_equals(navigator.presentation.receiver, null);
21 }, "Test that presentation.receiver returns non-null when the setting is set.");
22
23 test(t => {
24 internals.settings.setPresentationReceiver(true);
25 t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); });
26
14 assert_equals(typeof(navigator.presentation.receiver), "object"); 27 assert_equals(typeof(navigator.presentation.receiver), "object");
28
29 assert_true('connectionList' in navigator.presentation.receiver);
15 assert_equals(typeof(navigator.presentation.receiver.connectionList), "object" ); 30 assert_equals(typeof(navigator.presentation.receiver.connectionList), "object" );
16 }, "Test the Presentation Receiver API property types."); 31 }, "Test the Presentation Receiver API properties types and presence.");
17 32
18 </script> 33 </script>
19 </body> 34 </body>
20 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698