From a847380c46b7f5426ec0e9945ca08d9df1303683 Mon Sep 17 00:00:00 2001 From: Steve Melia Date: Sun, 29 May 2016 22:58:32 +0100 Subject: [PATCH] Bug 1259812: Fix tests to account for change in tooltip text and breadcrumb lifecycle;r=pbro MozReview-Commit-ID: 6KJOAhhgmkX --- devtools/client/inspector/breadcrumbs.js | 6 ++++-- .../test/browser_inspector_breadcrumbs_namespaced.js | 2 +- .../inspector/test/browser_inspector_initialization.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/devtools/client/inspector/breadcrumbs.js b/devtools/client/inspector/breadcrumbs.js index f64d29222fa5..305213589d5f 100644 --- a/devtools/client/inspector/breadcrumbs.js +++ b/devtools/client/inspector/breadcrumbs.js @@ -753,8 +753,10 @@ HTMLBreadcrumbs.prototype = { */ scroll: function () { // FIXME bug 684352: make sure its immediate neighbors are visible too. - let element = this.nodeHierarchy[this.currentIndex].button; - element.scrollIntoView({ block: "end", behavior: "smooth" }); + if (!this.isDestroyed) { + let element = this.nodeHierarchy[this.currentIndex].button; + element.scrollIntoView({ block: "end", behavior: "smooth" }); + } }, /** diff --git a/devtools/client/inspector/test/browser_inspector_breadcrumbs_namespaced.js b/devtools/client/inspector/test/browser_inspector_breadcrumbs_namespaced.js index 54c506d6f39e..0b14ef1b06c5 100644 --- a/devtools/client/inspector/test/browser_inspector_breadcrumbs_namespaced.js +++ b/devtools/client/inspector/test/browser_inspector_breadcrumbs_namespaced.js @@ -49,7 +49,7 @@ add_task(function* () { is(labelTag.textContent, node.nodeName, "Node " + node.selector + " has the expected tag name"); - is(checkedButton.getAttribute("tooltiptext"), node.title, + is(checkedButton.getAttribute("title"), node.title, "Node " + node.selector + " has the expected tooltip"); } }); diff --git a/devtools/client/inspector/test/browser_inspector_initialization.js b/devtools/client/inspector/test/browser_inspector_initialization.js index 9b1574082736..fe14a29bfde0 100644 --- a/devtools/client/inspector/test/browser_inspector_initialization.js +++ b/devtools/client/inspector/test/browser_inspector_initialization.js @@ -108,6 +108,6 @@ function* testBreadcrumbs(selector, inspector) { let expectedText = b.prettyPrintNodeAsText(nodeFront); let button = b.container.querySelector("button[checked=true]"); ok(button, "A crumbs is checked=true"); - is(button.getAttribute("tooltiptext"), expectedText, + is(button.getAttribute("title"), expectedText, "Crumb refers to the right node"); }