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

Unified Diff: LayoutTests/presentation/presentation-api.html

Issue 408663002: Add the Presentation API module and a single event target (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Made navigator.presentation an event target for onavailablechange (no implementation yet). Created 6 years, 5 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: LayoutTests/presentation/presentation-api.html
diff --git a/LayoutTests/presentation/presentation-api.html b/LayoutTests/presentation/presentation-api.html
new file mode 100644
index 0000000000000000000000000000000000000000..7eadfef22640c6f4fc1364607de1a3d59918ad3a
--- /dev/null
+++ b/LayoutTests/presentation/presentation-api.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+
+test(function() {
+ assert_true('presentation' in navigator);
+ assert_true('displayAvailable' in navigator.presentation);
+ assert_true('onavailablechange' in navigator.presentation);
+}, "Test that the Presentation API is present.")
+
+test(function() {
+ assert_equals(typeof(navigator.presentation), "object");
+ assert_equals(typeof(navigator.presentation.displayAvailable), "boolean");
+ assert_equals(typeof(navigator.presentation.onavailablechange), "object");
+}, "Test the Presentation API property types.");
+
+test(function() {
+ assert_true(navigator.presentation.displayAvailable);
+}, "Test the value of navigator.presentation.displayAvailable.");
+
+test(function() {
+ assert_true('addEventListener' in navigator.presentation);
+ assert_true('removeEventListener' in navigator.presentation);
+ assert_true('dispatchEvent' in navigator.presentation);
Peter Beverloo 2014/07/25 18:01:17 nit [25-27]: no need to test EventTarget or the in
whywhat 2014/08/19 18:07:34 I'm testing that navigator.presentation is EventTa
+ assert_true(navigator.presentation instanceof EventTarget)
+}, "Test that navigator.presentation is an EventTarget.");
+
+</script>
+</body>
+</html>
+
« no previous file with comments | « no previous file | Source/core/events/EventTypeNames.in » ('j') | Source/modules/presentation/NavigatorPresentation.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698