You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integration/messaging/test/static/helpers.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,8 @@ async function addPayloadToDb(payload) {
40
40
}
41
41
42
42
asyncfunctionaddPayloadToDbInternal(db,payload){
43
-
// onsuccess might race with onupgradeneeded. Consequently causing "object stores was not found" error. Therefore, wait briefly for db.createObjectStore to complete
43
+
// onsuccess might race with onupgradeneeded. Consequently causing "object stores was not found"
44
+
// error. Therefore, wait briefly for db.createObjectStore to complete
// 4 minutes. The fact that the flow includes making a request to the Send Service, storing/retrieving form indexedDb asynchronously makes these test units to have a execution time variance. Therefore, allowing these units to have a longer time to work is crucial.
38
+
// 4 minutes. The fact that the flow includes making a request to the Send Service,
39
+
// storing/retrieving form indexedDb asynchronously makes these test units to have a execution time
40
+
// variance. Therefore, allowing these units to have a longer time to work is crucial.
// 1 minute. Wait for object store to be created and received message to be stored in idb. This waiting time MUST be longer than the wait time for adding to db in the sw.
45
+
// 1 minute. Wait for object store to be created and received message to be stored in idb. This
46
+
// waiting time MUST be longer than the wait time for adding to db in the sw.
// Clearing the cache and db data by killing the previously instantiated driver. Note that ideally this call is placed inside the after/before hooks. However, Mocha forbids operations longer than 2s in hooks. Hence, this clearing call needs to be inside the test unit.
80
+
// Clearing the cache and db data by killing the previously instantiated driver. Note that
81
+
// ideally this call is placed inside the after/before hooks. However, Mocha forbids
82
+
// operations longer than 2s in hooks. Hence, this clearing call needs to be inside the
/** Getting received background messages are trickier than getting foreground messages from app. It requires idb object store creation with the service worker. Idb operations are fired as async events. This method needs to be called after the idb operations inside sw is done. In tests, consider adding a brief timeout before calling the method to give sw some time to work.
21
+
/** Getting received background messages are trickier than getting foreground messages from app. It
22
+
* requires idb object store creation with the service worker. Idb operations are fired as async
23
+
* events. This method needs to be called after the idb operations inside sw is done. In tests,
24
+
* consider adding a brief timeout before calling the method to give sw some time to work.
22
25
*/
23
26
module.exports=asyncwebdriver=>{
24
27
console.log('Getting received background messages from idb: ');
// Rotatable fcm server key. It's generally a bad idea to expose server keys. The reason is to simplify testing process (no need to implement server side decryption of git secret). The justification is that a) this is a disposable test project b) the key itself is rotatable.
20
+
// Rotatable fcm server key. It's generally a bad idea to expose server keys. The reason is to
21
+
// simplify testing process (no need to implement server side decryption of git secret). The
22
+
// justification is that a) this is a disposable test project b) the key itself is rotatable.
0 commit comments