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

Unified Diff: chrome/test/data/banners/appinstalled_test_page.html

Issue 2379923002: Implement "appinstalled" event on Android. (Closed)
Patch Set: Minor refactor. Created 4 years, 2 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: chrome/test/data/banners/appinstalled_test_page.html
diff --git a/chrome/test/data/banners/appinstalled_test_page.html b/chrome/test/data/banners/appinstalled_test_page.html
new file mode 100644
index 0000000000000000000000000000000000000000..98da3dc4639df28813d686dd91c94fc363369703
--- /dev/null
+++ b/chrome/test/data/banners/appinstalled_test_page.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
dominickn 2016/10/12 22:35:09 Possibly dumb question: could you put the JS in he
Matt Giuca 2016/12/09 04:36:48 Test pages used in this test: the other pages for
+<html>
+ <head>
+ <title>appinstalled event test page</title>
+ <script>
+ var eventCounter = 0;
+
+ function onAppInstalled() {
+ eventCounter++;
+ window.document.title = 'Got appinstalled ' + eventCounter
+ + ' times';
+ }
+
+ window.addEventListener('load', () => {
+ // Test both the addEventListener and onX attribute versions.
+ // When an app is installed, this should fire twice.
+ window.addEventListener('appinstalled', onAppInstalled);
+ window.onappinstalled = onAppInstalled;
+ });
+ </script>
+ </head>
+ <body>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698