blob: 38efb15a748504a455cb5388e5b901392fd695d4 [file] [log] [blame]
<script src="./helper.js"></script>
<script>
'use strict';
// Intercept successful calls and return mocked value.
(async function() {
await expect(receive).andReturn(() => {
return Promise.resolve({
status: Status.kSuccess,
message: "hello",
});
});
}());
window.onload = function() {
navigator.sms.receive()
.then(sms => {
window.parent.postMessage({result: "Pass", sms: sms.content}, '*');
})
.catch(error => {
window.parent.postMessage({result: "Fail", errorType: error.name}, '*');
});
}
</script>