Commit 8569349a authored by johnme's avatar johnme Committed by Commit bot

Add tests for notifications infobar on Android

BUG=644050

Review-Url: https://codereview.chromium.org/2316303004
Cr-Commit-Position: refs/heads/master@{#417369}
parent 46984b99
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment