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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate.html

Issue 2855133004: Re-enable feature policy layout tests after bug fix. (Closed)
Patch Set: Updated fp-vibrate tests expect Created 3 years, 7 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: third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate.html
new file mode 100644
index 0000000000000000000000000000000000000000..ac1781d2e8df0f160dec4b9d1d3347c2bd2191cf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<title>Feature-Policy Vibrate</title>
+<script src="/js-test-resources/user-gesture-utils.js"></script>
+<button id="test">Click to vibrate</button>
+<script>
+function startTest(event) {
+ // Simulates a user click for vibrate to be allowed.
+ var element = document.getElementById('test');
+ document.querySelector('button').addEventListener('click', testVibrate);
+ simulateUserClick(element.offsetLeft + event.data.x + 2,
+ element.offsetTop + event.data.y + 2);
+}
+
+function testVibrate() {
+ if (navigator.vibrate(200)) {
+ parent.postMessage({ type: 'result', enabled: true }, '*');
+ } else {
+ parent.postMessage({ type: 'result', enabled: false }, '*');
+ }
+}
+
+window.addEventListener('message', startTest, true);
+window.addEventListener('load', function() {
+ parent.postMessage({ type: 'onload'}, '*');
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698