| 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 chrome.test.runWithModuleSystem(function(moduleSystem) { | 5 chrome.test.runWithModuleSystem(function(moduleSystem) { |
| 6 window.AutomationRootNode = | 6 window.AutomationRootNode = |
| 7 moduleSystem.require('automationNode').AutomationRootNode; | 7 moduleSystem.require('automationNode').AutomationRootNode; |
| 8 window.privates = moduleSystem.privates; | 8 window.privates = moduleSystem.privates; |
| 9 // Unused. | 9 // Unused. |
| 10 window.automationUtil = function() {}; | 10 window.automationUtil = function() {}; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 function testEditableTextMixins() { | 283 function testEditableTextMixins() { |
| 284 var update = { 'nodeIdToClear': 0, 'nodes': [ | 284 var update = { 'nodeIdToClear': 0, 'nodes': [ |
| 285 { | 285 { |
| 286 'id': 1, 'role': 'rootWebArea', | 286 'id': 1, 'role': 'rootWebArea', |
| 287 'boolAttributes': { 'docLoaded': true }, | 287 'boolAttributes': { 'docLoaded': true }, |
| 288 'stringAttributes': { 'docUrl': 'chrome://terms', | 288 'stringAttributes': { 'docUrl': 'chrome://terms', |
| 289 'docTitle': 'Google Chrome Terms of Service' }, | 289 'docTitle': 'Google Chrome Terms of Service' }, |
| 290 'intAttributes': { 'scrollY': 583, | 290 'intAttributes': { 'scrollY': 583, |
| 291 'scrollYMax': 9336 }, | 291 'scrollYMax': 9336 }, |
| 292 'childIds': [2, 3, 4] | 292 'childIds': [2, 3] |
| 293 }, | 293 }, |
| 294 { | 294 { |
| 295 'id': 2, 'role': 'editableText', | 295 'id': 2, 'role': 'textField', |
| 296 'childIds': [] | |
| 297 }, | |
| 298 { | |
| 299 'id': 3, 'role': 'textField', | |
| 300 'intAttributes': { 'textSelStart': 10, 'textSelEnd': 20 }, | 296 'intAttributes': { 'textSelStart': 10, 'textSelEnd': 20 }, |
| 301 'childIds': [] | 297 'childIds': [] |
| 302 }, | 298 }, |
| 303 { | 299 { |
| 304 'id': 4, 'role': 'textArea', | 300 'id': 3, 'role': 'textArea', |
| 305 'childIds': [] | 301 'childIds': [] |
| 306 }, | 302 }, |
| 307 | 303 |
| 308 ] }; | 304 ] }; |
| 309 | 305 |
| 310 var tree = new AutomationRootNode(); | 306 var tree = new AutomationRootNode(); |
| 311 assertTrue(privates(tree).impl.unserialize(update)); | 307 assertTrue(privates(tree).impl.unserialize(update)); |
| 312 assertEq(true, tree.docLoaded); | 308 assertEq(true, tree.docLoaded); |
| 313 assertFalse('textSelStart' in tree); | 309 assertFalse('textSelStart' in tree); |
| 314 assertFalse('textSelEnd' in tree); | 310 assertFalse('textSelEnd' in tree); |
| 315 var editableText = tree.firstChild; | 311 var textField = tree.firstChild; |
| 316 assertEq(-1, editableText.textSelStart); | |
| 317 assertEq(-1, editableText.textSelEnd); | |
| 318 var textField = editableText.nextSibling; | |
| 319 assertEq(10, textField.textSelStart); | 312 assertEq(10, textField.textSelStart); |
| 320 assertEq(20, textField.textSelEnd); | 313 assertEq(20, textField.textSelEnd); |
| 321 var textArea = textField.nextSibling; | 314 var textArea = textField.nextSibling; |
| 322 assertEq(-1, textArea.textSelStart); | 315 assertEq(-1, textArea.textSelStart); |
| 323 assertEq(-1, textArea.textSelEnd); | 316 assertEq(-1, textArea.textSelEnd); |
| 324 | 317 |
| 325 succeed(); | 318 succeed(); |
| 326 }, | 319 }, |
| 327 | 320 |
| 328 function testRangeMixins() { | 321 function testRangeMixins() { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 assertEq(1, cell4.tableCellColumnIndex); | 497 assertEq(1, cell4.tableCellColumnIndex); |
| 505 assertEq(1, cell4.tableCellColumnSpan); | 498 assertEq(1, cell4.tableCellColumnSpan); |
| 506 assertEq(1, cell4.tableCellRowIndex); | 499 assertEq(1, cell4.tableCellRowIndex); |
| 507 assertEq(1, cell4.tableCellRowSpan); | 500 assertEq(1, cell4.tableCellRowSpan); |
| 508 | 501 |
| 509 succeed(); | 502 succeed(); |
| 510 } | 503 } |
| 511 ]; | 504 ]; |
| 512 | 505 |
| 513 chrome.test.runTests(tests); | 506 chrome.test.runTests(tests); |
| OLD | NEW |