@@ -52,6 +52,8 @@ Rectangle {
52 function cleanup()
52 function cleanup()
54 spy.clear();
54 spy.clear();
55+ var button = findChild(root, "paymentButton");
57 function test_purchase_text_display() {
59 function test_purchase_text_display() {
@@ -79,6 +81,28 @@ Rectangle {
79 compare(args[2], jsonPurchase["source"]);
81 compare(args[2], jsonPurchase["source"]);
84+ function test_progress_show() {
85+ // Make sure the progress bar is shown.
86+ previewPayments.widgetData = jsonPurchase;
88+ var button = findChild(root, "paymentButton");
89+ var progress = findChild(root, "loadingBar");
91+ tryCompare(progress, "visible", false);
92+ tryCompare(progress, "opacity", 0);
93+ tryCompare(button, "visible", true);
94+ tryCompare(button, "opacity", 1);
96+ mouseClick(button, button.width / 2, button.height / 2);
100+ tryCompare(progress, "visible", true);
101+ tryCompare(progress, "opacity", 1);
102+ tryCompare(button, "visible", false);
103+ tryCompare(button, "opacity", 0);
82 function test_purchase_error() {
106 function test_purchase_error() {
83 // The mock Payments triggers an error when com.example.invalid is
107 // The mock Payments triggers an error when com.example.invalid is
84 // passed to it as store_item_id. Exercise it here
108 // passed to it as store_item_id. Exercise it here