@@ -103,6 +103,37 @@ Rectangle {
103 tryCompare(button, "opacity", 0);
103 tryCompare(button, "opacity", 0);
106+ function test_progress_show_cancel() {
107+ // Make sure the progress bar is shown.
108+ previewPayments.widgetData = jsonPurchase;
110+ var button = findChild(root, "paymentButton");
111+ var progress = findChild(root, "loadingBar");
113+ tryCompare(progress, "visible", false);
114+ tryCompare(progress, "opacity", 0);
115+ tryCompare(button, "visible", true);
116+ tryCompare(button, "opacity", 1);
118+ mouseClick(button, button.width / 2, button.height / 2);
122+ tryCompare(progress, "visible", true);
123+ tryCompare(progress, "opacity", 1);
124+ tryCompare(button, "visible", false);
125+ tryCompare(button, "opacity", 0);
127+ var paymentClient = findChild(root, "paymentClient");
128+ paymentClient.storeItemId = "com.example.invalid";
129+ paymentClient.start();
131+ tryCompare(progress, "visible", false);
132+ tryCompare(progress, "opacity", 0);
133+ tryCompare(button, "visible", true);
134+ tryCompare(button, "opacity", 1);
106 function test_purchase_error() {
137 function test_purchase_error() {
107 // The mock Payments triggers an error when com.example.invalid is
138 // The mock Payments triggers an error when com.example.invalid is
108 // passed to it as store_item_id. Exercise it here
139 // passed to it as store_item_id. Exercise it here