~aacid/unity8/scopes_more_things_on_memory

« back to all changes in this revision

Viewing changes to tests/qmltests/Dash/tst_Card.qml

  • Committer: Albert Astals
  • Date: 2014-09-01 10:25:28 UTC
  • Revision ID: albert.astals@canonical.com-20140901102528-0guv05s4dz1vuy2e
test the visible+network code for card images

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import QtQuick 2.0
18
18
import QtTest 1.0
19
19
import Ubuntu.Components 0.1
 
20
import Ubuntu.Connectivity 1.0
20
21
import Unity.Test 0.1 as UT
21
22
import "../../../qml/Dash"
22
23
import "CardHelpers.js" as Helpers
566
567
                verify((card.width - titleToCard.x - titleToCard.width) === units.gu(1));
567
568
            }
568
569
        }
 
570
 
 
571
        function test_load_images_visibility_network_data() {
 
572
            return [
 
573
                { tag: "Visible, network", visible: true, limitedBandwith: false },
 
574
                { tag: "Visible, no network", visible: true, limitedBandwith: true },
 
575
                { tag: "Not Visible, network", visible: false, limitedBandwith: false },
 
576
                { tag: "Not Visible, no network", visible: false, limitedBandwith: true }
 
577
            ];
 
578
        }
 
579
 
 
580
        function test_load_images_visibility_network(data) {
 
581
            loader.visible = data.visible;
 
582
            NetworkingStatus.limitedBandwith = data.limitedBandwith;
 
583
 
 
584
            selector.selectedIndex = 0;
 
585
            waitForRendering(selector);
 
586
            waitForRendering(card);
 
587
 
 
588
            verify(data.visible || !data.limitedBandwith || artImage.source == "");
 
589
        }
569
590
    }
570
591
}