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

Unified Diff: chrome/test/data/notifications/android_test.html

Issue 2316303004: Add tests for notifications infobar on Android (Closed)
Patch Set: Review nits 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/notifications/NotificationPlatformBridgeTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/notifications/android_test.html
diff --git a/chrome/test/data/notifications/android_test.html b/chrome/test/data/notifications/android_test.html
index 08e707fcc057ee4713238c15bb19564370c318f2..7d6dfce5eba56a0858556cad37b9f2a6e9bdc34b 100644
--- a/chrome/test/data/notifications/android_test.html
+++ b/chrome/test/data/notifications/android_test.html
@@ -5,15 +5,28 @@
<title>Android Web Notifications Instrumentation test-page</title>
</head>
<body>
- <!-- This page is used by the NotificationUIManagerTest instrumentation test
- suite on Android. -->
+ <!-- This page is used by the NotificationPlatformBridgeTest instrumentation
+ test suite on Android. -->
<script src="notification_test_utils.js"></script>
<script>
function showNotification(title, options) {
GetActivatedServiceWorker('android_test_worker.js', location.pathname)
- .then(function(registration) {
- registration.showNotification(title, options);
- });
+ .then(registration => registration.showNotification(title, options))
+ .catch(sendToTest);
+ }
+
+ // NotificationPlatformBridgeTest observes changes to the tab title as an
+ // asynchronous response mechanism from JavaScript to Java.
+ var errorCounter = 0;
+ function sendToTest(message) {
+ // Duplicate messages cannot be detected by the test, don't send them.
+ if (message == document.title) {
+ console.log('Duplicate message: ' + message);
+ message =
+ 'Error ' + errorCounter + ' - duplicate message: ' + message;
+ errorCounter++;
+ }
+ document.title = message;
}
</script>
</body>
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698