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

Unified Diff: LayoutTests/presentation/availablechange-event.html

Issue 906673002: Added layout test for |availablechange| event. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: The simplest async test? Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/presentation/availablechange-event.html
diff --git a/LayoutTests/presentation/availablechange-event.html b/LayoutTests/presentation/availablechange-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..5950dfa967ec7d3c793aaae46b9a3cdbde053b8a
--- /dev/null
+++ b/LayoutTests/presentation/availablechange-event.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Tests the Presentation API's availablechange event's expected behavior.</title>
+</head>
+<body>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+
+var availableChangeTest = async_test(
+ "Test that availablechange event is fired when the screen availability becomes true.");
+
+navigator.presentation.onavailablechange = function(e) {
+ availableChangeTest.step(function() {
+ assert_true(e.available);
+ availableChangeTest.done();
+ });
+}
+
+// Some screens are available, event must be fired with e.available set to true.
+window.testRunner.setMockScreenAvailability(true);
+
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698