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

Unified 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, 1 month 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/presentation/presentation-receiver.html
diff --git a/third_party/WebKit/LayoutTests/presentation/presentation-receiver.html b/third_party/WebKit/LayoutTests/presentation/presentation-receiver.html
index 31af39454ed4a82399422c4bcfe32ea9421031f7..714eb38c0bbca354da99f61329b78231a0453a53 100644
--- a/third_party/WebKit/LayoutTests/presentation/presentation-receiver.html
+++ b/third_party/WebKit/LayoutTests/presentation/presentation-receiver.html
@@ -5,15 +5,30 @@
<script src="../resources/testharnessreport.js"></script>
<script>
-test(function() {
- assert_true('receiver' in navigator.presentation);
- assert_true('connectionList' in navigator.presentation.receiver);
-}, "Test that the Presentation Receiver API is present.")
+test(t => {
+ assert_true('receiver' in navigator.presentation);
+}, "Test that presentation.receiver is present.")
+
+test(t => {
+ assert_equals(navigator.presentation.receiver, null);
+}, "Test that presentation.receiver returns null when the setting is not set.");
+
+test(t => {
+ internals.settings.setPresentationReceiver(true);
+ t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); });
+
+ assert_not_equals(navigator.presentation.receiver, null);
+}, "Test that presentation.receiver returns non-null when the setting is set.");
+
+test(t => {
+ internals.settings.setPresentationReceiver(true);
+ t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); });
-test(function() {
assert_equals(typeof(navigator.presentation.receiver), "object");
+
+ assert_true('connectionList' in navigator.presentation.receiver);
assert_equals(typeof(navigator.presentation.receiver.connectionList), "object");
-}, "Test the Presentation Receiver API property types.");
+}, "Test the Presentation Receiver API properties types and presence.");
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698