michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * Test for Bug 655273. Make sure that after changing the URI via michael@0: * history.pushState, the resulting SHEntry has the same title as our old michael@0: * SHEntry. michael@0: **/ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: let tab = gBrowser.addTab('http://example.com'); michael@0: let tabBrowser = tab.linkedBrowser; michael@0: michael@0: tabBrowser.addEventListener('load', function(aEvent) { michael@0: tabBrowser.removeEventListener('load', arguments.callee, true); michael@0: michael@0: let cw = tabBrowser.contentWindow; michael@0: let oldTitle = cw.document.title; michael@0: ok(oldTitle, 'Content window should initially have a title.'); michael@0: cw.history.pushState('', '', 'new_page'); michael@0: michael@0: let shistory = cw.QueryInterface(Ci.nsIInterfaceRequestor) michael@0: .getInterface(Ci.nsIWebNavigation) michael@0: .sessionHistory; michael@0: michael@0: is(shistory.getEntryAtIndex(shistory.index, false).title, michael@0: oldTitle, 'SHEntry title after pushstate.'); michael@0: michael@0: gBrowser.removeTab(tab); michael@0: finish(); michael@0: }, true); michael@0: }