~diegosarmentero/click-update-manager/settings-link

« back to all changes in this revision

Viewing changes to tests/unit/unit_test.js

  • Committer: Tarmac
  • Author(s): Diego Sarmentero
  • Date: 2013-09-23 16:35:55 UTC
  • mfrom: (16.2.4 click-update-manager)
  • Revision ID: tarmac-20130923163555-qew0xpbfedup6aav
- Adding tests for the qml components and missing icon. Fixes: https://bugs.launchpad.net/bugs/1228307.

Approved by PS Jenkins bot, Manuel de la Peña, Roberto Alsina.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.pragma library
 
2
 
 
3
// Find an object with the given name in the children tree of "obj"
 
4
function findChild(obj,objectName) {
 
5
    var childs = new Array(0);
 
6
    childs.push(obj)
 
7
    while (childs.length > 0) {
 
8
        if (childs[0].objectName == objectName) {
 
9
            return childs[0]
 
10
        }
 
11
        for (var i in childs[0].children) {
 
12
            childs.push(childs[0].children[i])
 
13
        }
 
14
        childs.splice(0, 1);
 
15
    }
 
16
    return undefined;
 
17
}