Publish Vulpes Preview 15 sources for desktop, Android and Tundra

Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,60 @@
/* global NotificationHandler
*/
'use strict';
require('/js/notification/notification.js');
suite('Network Alerts - Notification handling', function() {
setup(function() {
this.sinon.stub(window, 'close');
this.sinon.stub(window, 'open');
// We only need titleID after parsing, so mock parseParams that simply
// return fake titleID for testing.
if (!window.navigator.mozSetMessageHandler) {
window.navigator.mozSetMessageHandler = function() {};
}
this.sinon.stub(window.navigator, 'mozSetMessageHandler');
NotificationHandler.init();
});
test('opens an attention screen if user clicks the notification', function() {
var message = {
title: 'Some title',
body: 'Some body',
clicked: true,
data: { title: 'Some title' }
};
var handlerStub = window.navigator.mozSetMessageHandler;
handlerStub.withArgs('notification').yield(message);
var expectedUrl = [
'attention.html?',
'title=Some%20title&',
'body=Some%20body&',
'notification=1'
].join('');
sinon.assert.calledWith(
window.open,
expectedUrl, '_blank', 'attention'
);
sinon.assert.notCalled(window.close);
});
test('only closes window if user dismisses the notification', function() {
var message = {
title: 'Some title',
body: 'Some body'
};
var handlerStub = window.navigator.mozSetMessageHandler;
handlerStub.withArgs('notification').yield(message);
sinon.assert.notCalled(window.open);
sinon.assert.called(window.close);
});
});