| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/components/iron-flex-layout/iron-flex-layout-classes.h
tml"> | 8 <link rel="import" href="/components/iron-flex-layout/iron-flex-layout-classes.h
tml"> |
| 9 <link rel="import" href="/components/paper-button/paper-button.html"> | 9 <link rel="import" href="/components/paper-button/paper-button.html"> |
| 10 <link rel="import" href="/components/paper-icon-button/paper-icon-button.html"> | 10 <link rel="import" href="/components/paper-icon-button/paper-icon-button.html"> |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 parts.unshift(bot); | 475 parts.unshift(bot); |
| 476 | 476 |
| 477 if (parts.length < maxLevel) return undefined; | 477 if (parts.length < maxLevel) return undefined; |
| 478 return parts.join('/'); | 478 return parts.join('/'); |
| 479 }, | 479 }, |
| 480 | 480 |
| 481 getCurrentSelectedPath() { | 481 getCurrentSelectedPath() { |
| 482 return this.currentSelectedPath_; | 482 return this.currentSelectedPath_; |
| 483 }, | 483 }, |
| 484 | 484 |
| 485 async setCurrentSelectedPath(testPath) { |
| 486 this.updatingSubtestMenus = true; |
| 487 for (let boxIndex = 0; boxIndex < testPath.length; ++boxIndex) { |
| 488 const menu = this.getSelectionMenu(boxIndex); |
| 489 const name = testPath[boxIndex]; |
| 490 let found = false; |
| 491 |
| 492 for (const menuItem of menu.items) { |
| 493 if (menuItem.name === name) { |
| 494 found = true; |
| 495 menu.selectedItem = menuItem; |
| 496 break; |
| 497 } |
| 498 } |
| 499 |
| 500 if (!found) { |
| 501 this.updatingSubtestMenus = false; |
| 502 throw new Error(`Invalid testPath ${testPath} @ ${boxIndex}`); |
| 503 } |
| 504 |
| 505 if (boxIndex == 0) { |
| 506 this.updateTestSuiteDescription(); |
| 507 await this.updateBotMenu(); |
| 508 } else { |
| 509 await this.updateSubtestMenus(boxIndex + 1); |
| 510 } |
| 511 } |
| 512 this.updatingSubtestMenus = false; |
| 513 }, |
| 514 |
| 485 getCurrentUnselected() { | 515 getCurrentUnselected() { |
| 486 return this.currentUnselectedTests_; | 516 return this.currentUnselectedTests_; |
| 487 }, | 517 }, |
| 488 | 518 |
| 489 async getSubtestsForPath(path, returnSelected) { | 519 async getSubtestsForPath(path, returnSelected) { |
| 490 // TODO(eakuefner): Reimplement cancellation and memoize. | 520 // TODO(eakuefner): Reimplement cancellation and memoize. |
| 491 // TODO(eakuefner): Fix error handling. | 521 // TODO(eakuefner): Fix error handling. |
| 492 const params = { | 522 const params = { |
| 493 type: 'test_path_dict' | 523 type: 'test_path_dict' |
| 494 }; | 524 }; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 * Converts a link in markdown format to a HTML link (anchor elements). | 569 * Converts a link in markdown format to a HTML link (anchor elements). |
| 540 * @param {string} text A link in markdown format. | 570 * @param {string} text A link in markdown format. |
| 541 * @return {string} A hyperlink string. | 571 * @return {string} A hyperlink string. |
| 542 */ | 572 */ |
| 543 convertMarkdownLinks(text) { | 573 convertMarkdownLinks(text) { |
| 544 return text.replace(/\[(.+?)\]\((.+?)\)/g, '<a href="$2">$1</a>'); | 574 return text.replace(/\[(.+?)\]\((.+?)\)/g, '<a href="$2">$1</a>'); |
| 545 } | 575 } |
| 546 }); | 576 }); |
| 547 </script> | 577 </script> |
| 548 </dom-module> | 578 </dom-module> |
| OLD | NEW |