| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var AutomationEvent = require('automationEvent').AutomationEvent; | 5 var AutomationEvent = require('automationEvent').AutomationEvent; |
| 6 var automationInternal = | 6 var automationInternal = |
| 7 require('binding').Binding.create('automationInternal').generate(); | 7 require('binding').Binding.create('automationInternal').generate(); |
| 8 var IsInteractPermitted = | 8 var IsInteractPermitted = |
| 9 requireNative('automationInternal').IsInteractPermitted; | 9 requireNative('automationInternal').IsInteractPermitted; |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 firstChild: function() { | 46 firstChild: function() { |
| 47 return this.childTree || this.rootImpl.get(this.childIds[0]); | 47 return this.childTree || this.rootImpl.get(this.childIds[0]); |
| 48 }, | 48 }, |
| 49 | 49 |
| 50 lastChild: function() { | 50 lastChild: function() { |
| 51 var childIds = this.childIds; | 51 var childIds = this.childIds; |
| 52 return this.childTree || this.rootImpl.get(childIds[childIds.length - 1]); | 52 return this.childTree || this.rootImpl.get(childIds[childIds.length - 1]); |
| 53 }, | 53 }, |
| 54 | 54 |
| 55 children: function() { | 55 children: function() { |
| 56 if (this.childTree) |
| 57 return [this.childTree]; |
| 58 |
| 56 var children = []; | 59 var children = []; |
| 57 for (var i = 0, childID; childID = this.childIds[i]; i++) { | 60 for (var i = 0, childID; childID = this.childIds[i]; i++) { |
| 58 logging.CHECK(this.rootImpl.get(childID)); | 61 logging.CHECK(this.rootImpl.get(childID)); |
| 59 children.push(this.rootImpl.get(childID)); | 62 children.push(this.rootImpl.get(childID)); |
| 60 } | 63 } |
| 61 return children; | 64 return children; |
| 62 }, | 65 }, |
| 63 | 66 |
| 64 previousSibling: function() { | 67 previousSibling: function() { |
| 65 var parent = this.parent(); | 68 var parent = this.parent(); |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 'attributes', | 741 'attributes', |
| 739 'indexInParent', | 742 'indexInParent', |
| 740 'root'] }); | 743 'root'] }); |
| 741 | 744 |
| 742 var AutomationRootNode = utils.expose('AutomationRootNode', | 745 var AutomationRootNode = utils.expose('AutomationRootNode', |
| 743 AutomationRootNodeImpl, | 746 AutomationRootNodeImpl, |
| 744 { superclass: AutomationNode }); | 747 { superclass: AutomationNode }); |
| 745 | 748 |
| 746 exports.AutomationNode = AutomationNode; | 749 exports.AutomationNode = AutomationNode; |
| 747 exports.AutomationRootNode = AutomationRootNode; | 750 exports.AutomationRootNode = AutomationRootNode; |
| OLD | NEW |