@@ -52,6 +52,8 @@ Rectangle {
5252 function cleanup()
5353 {
5454 spy.clear();
55+ var button = findChild(root, "paymentButton");
56+ button.opacity = 1;
5557 }
5658
5759 function test_purchase_text_display() {
@@ -79,6 +81,28 @@ Rectangle {
7981 compare(args[2], jsonPurchase["source"]);
8082 }
8183
84+ function test_progress_show() {
85+ // Make sure the progress bar is shown.
86+ previewPayments.widgetData = jsonPurchase;
87+
88+ var button = findChild(root, "paymentButton");
89+ var progress = findChild(root, "loadingBar");
90+
91+ tryCompare(progress, "visible", false);
92+ tryCompare(progress, "opacity", 0);
93+ tryCompare(button, "visible", true);
94+ tryCompare(button, "opacity", 1);
95+
96+ mouseClick(button, button.width / 2, button.height / 2);
97+
98+ spy.wait();
99+
100+ tryCompare(progress, "visible", true);
101+ tryCompare(progress, "opacity", 1);
102+ tryCompare(button, "visible", false);
103+ tryCompare(button, "opacity", 0);
104+ }
105+
82106 function test_purchase_error() {
83107 // The mock Payments triggers an error when com.example.invalid is
84108 // passed to it as store_item_id. Exercise it here