Merge lp:~zsombi/ubuntu-ui-toolkit/crossFadeImage_SourceSize_fix into lp:ubuntu-ui-toolkit
Proposed by
Zsombor Egri
Status: | Rejected |
---|---|
Rejected by: | Tim Peeters |
Proposed branch: | lp:~zsombi/ubuntu-ui-toolkit/crossFadeImage_SourceSize_fix |
Merge into: | lp:ubuntu-ui-toolkit |
Diff against target: |
120 lines (+55/-2) 4 files modified
CHANGES (+1/-0) components.api (+1/-1) modules/Ubuntu/Components/CrossFadeImage.qml (+41/-1) tests/unit/tst_components/tst_CrossFadeImage.qml (+12/-0) |
To merge this branch: | bzr merge lp:~zsombi/ubuntu-ui-toolkit/crossFadeImage_SourceSize_fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Peeters | Disapprove | ||
PS Jenkins bot | continuous-integration | Needs Fixing | |
Zoltan Balogh | Approve | ||
Review via email: mp+188778@code.launchpad.net |
Commit message
Update CrossFadeImage API so that sourceSize can be set by the applications.
Description of the change
This MR was taken over from timp as his one fails on minor qdoc issues [1], and contains nothing more than the qdoc fix. The original MR was reviewed and top-approved, this failure sniffed in by mistake.
[1] https:/
To post a comment you must log in.
Unmerged revisions
- 776. By Zsombor Egri
-
qdoc failure fixed
- 775. By Zsombor Egri
-
bug attached
- 774. By Zsombor Egri
-
timp's MR merged - lp:~tpeeters/ubuntu-ui-toolkit/crossFadeImage_SourceSize_fix
108 + "../../ ../examples/ ubuntu- ui-toolkit- gallery/ demo_image. jpg"); crossFadeImage. sourceSize. width, 640, "Source width incorrectly initialized."); crossFadeImage. sourceSize. height, 427, "Source height incorrectly initialized."); sourceSize. width = 100; sourceSize. height = 101; crossFadeImage. sourceSize. width, 100, "Source width incorrectly updated."); crossFadeImage. sourceSize. height, 101, "Source height incorrectly updated.");
109 + function test_sourceSize() {
110 + loadImage(
111 + compare(
112 + compare(
113 + crossFadeImage.
114 + crossFadeImage.
115 + compare(
116 + compare(
117 + waitForAnimation();
118 + cleanupTest();
119 + }
I've seen many of those tests in the SDK and I personally think this is quite useless. It only tests if the component actually compiles (ok, better than nothing) and if there actually is a property size sourceSize which is not readonly. That's it. But if the sourceSize is actually used by image? This is not tested. Here's an example how to check that:
// Put this into some helper.js, or TestCaseBase class to inherit from as you're gonna need this in every test as of now. In unity we have a UnityTestCase which inherits a TestCase and adds lots of useful helpers. Feel free to copy that too.
// Find an object with the given name in the children tree of "obj" obj,objectName) {
childs. push(obj) 0].objectName == objectName) {
return childs[0]
childs. push(childs[ 0].children[ i])
childs. splice( 0, 1);
function findChild(
var childs = new Array(0);
while (childs.length > 0) {
if (childs[
}
for (var i in childs[0].children) {
}
}
return undefined;
}
// Now we have a way to look inside the components. Let's do the test using this:
Edit CrossFadeImage.qml and add "objectName" properties to image1 and image2, like this:
Image {
id: image1
objectName: "image1"
...
}
And now the test
function test_sourceSize() { "../../ ../examples/ ubuntu- ui-toolkit- gallery/ demo_image. jpg"); crossFadeImage. sourceSize. width, 640, "Source width incorrectly initialized."); crossFadeImage. sourceSize. height, 427, "Source height incorrectly initialized."); e.sourceSize. width = 100; e.sourceSize. height = 101;
loadImage(
compare(
compare(
crossFadeImag
crossFadeImag
var image1 = findChild( crossFadeImage, "image1"); crossFadeImage, "image2");
var image2 = findChild(
compare( image1. sourceSize. width, 100, "Source width incorrectly updated."); image1. sourceSize. height, 101, "Source height incorrectly updated.");
compare(
compare( image2. sourceSize. width, 100, "Source width incorrectly updated."); image2. sourceSize. height, 101, "Source height incorrectly updated.");
compare(
waitForAnimat ion();
cleanupTest();
}