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wczovL21hcmtldHBsYWNlLmZpcmVmb3guY29tL2FwaS92MS9yZWNlaXB0cy9yZWlzc3VlLyIsICJ1c2VyIjogeyJ0eXBlIjogImRpcmVjdGVkLWlkZW50aWZpZXIiLCAidmFsdWUiOiAiMTkzMzI2LTVjMTUzNmQ1LWUxMDQtNDAzYy04NDBlLTQ5YjMyMmQ5Yjg4NSJ9LCAiZXhwIjogMTQwMTgyNTEyOCwgImlhdCI6IDEzODYxMDAzMjgsICJ0eXAiOiAicHVyY2hhc2UtcmVjZWlwdCIsICJuYmYiOiAxMzg2MTAwMzI4fQ.r2DVUpouRDJYqZe61LJBcIwmeF2mI8FmbGMRlfNFcinKAIs8nMVVNX8xSWJ6jXXgZ62VfHJCLHapADX8rCg6NgxFV_FdP7j2H_2Ufo0E0TREifTN6V4v1dCnzDulNhZmO8G-nQJUVOAtNfNC95PY7tVa8WC7dYXnKZsD6NhIxxVEtBGuiiySpWArI-g3pcl41rXNHHpJbRfrOD4QgVNrsV83TWILYRr6PWr3aqOM2XT_x2SzEfhBNvdG8AJmR0MKQytvfcgz3Vt1hMak88nFrzTLiKkuuPAXpwB5q83LZIl4EYG3UAnte4-XWlLb-NJ78vgXa64myy-3fPr7EO6LaQ';
// Test removeReceipt or replaceReceipt when there the app doesn't have any receipt
request = app.replaceReceipt(receipt1, receipt3);
request.onsuccess = function() {
ok(false, "replaceReceipt should fail if the app doesn't have any receipt");
}
request.onerror = function() {
ok(this.error.name == "NO_SUCH_RECEIPT",
"Request failed because there isn't any receipt");
continueTest();
}
yield undefined;
request = app.removeReceipt(receipt1);
request.onsuccess = function() {
ok(false, "removeReceipt should fail if the app doesn't have any receipt");
}
request.onerror = function() {
ok(this.error.name == "NO_SUCH_RECEIPT",
"Request failed because there isn't any receipt");