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

Unified Diff: content/test/data/android/webshare.html

Issue 2338203002: Added end-to-end tests for navigator.share. (Closed)
Patch Set: Rebase. Created 4 years, 3 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 | « chrome/android/javatests/src/org/chromium/chrome/browser/WebShareTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/android/webshare.html
diff --git a/content/test/data/android/webshare.html b/content/test/data/android/webshare.html
new file mode 100644
index 0000000000000000000000000000000000000000..14e7c734d7861780052c6e9a18fe299a452b48e3
--- /dev/null
+++ b/content/test/data/android/webshare.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Web Share</title>
+ <script>
+ function initiate_share() {
+ if (navigator.share === undefined) {
+ window.document.title = 'Fail: navigator.share === undefined';
+ return;
+ }
+
+ var data = {title: "Test Title", text: "Test Text",
+ url: "https://test.url"};
+ navigator.share(data).then(() => {
+ window.document.title = 'Success';
+ }).catch(e => {
+ window.document.title = 'Fail: ' + e;
+ });
+ }
+
+ window.addEventListener('load', () => {
+ window.addEventListener('click', initiate_share);
+ });
+ </script>
+ </head>
+ <body>
+ </body>
+</html>
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/WebShareTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698