Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | * http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | "use strict"; |
michael@0 | 5 | |
michael@0 | 6 | const URL = ROOT + "browser_485482_sample.html"; |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * Bug 485482 - Make sure that we produce valid XPath expressions even for very |
michael@0 | 10 | * weird HTML documents. |
michael@0 | 11 | */ |
michael@0 | 12 | add_task(function test_xpath_exp_for_strange_documents() { |
michael@0 | 13 | // Load a page with weird tag names. |
michael@0 | 14 | let tab = gBrowser.addTab(URL); |
michael@0 | 15 | let browser = tab.linkedBrowser; |
michael@0 | 16 | yield promiseBrowserLoaded(browser); |
michael@0 | 17 | |
michael@0 | 18 | // Fill in some values. |
michael@0 | 19 | let uniqueValue = Math.random(); |
michael@0 | 20 | yield setInputValue(browser, {selector: "input[type=text]", value: uniqueValue}); |
michael@0 | 21 | yield setInputChecked(browser, {selector: "input[type=checkbox]", checked: true}); |
michael@0 | 22 | |
michael@0 | 23 | // Duplicate the tab. |
michael@0 | 24 | let tab2 = gBrowser.duplicateTab(tab); |
michael@0 | 25 | let browser2 = tab2.linkedBrowser; |
michael@0 | 26 | yield promiseTabRestored(tab2); |
michael@0 | 27 | |
michael@0 | 28 | // Check that we generated valid XPath expressions to restore form values. |
michael@0 | 29 | let text = yield getInputValue(browser2, {selector: "input[type=text]"}); |
michael@0 | 30 | is(text, uniqueValue, "generated XPath expression was valid"); |
michael@0 | 31 | let checkbox = yield getInputChecked(browser2, {selector: "input[type=checkbox]"}); |
michael@0 | 32 | ok(checkbox, "generated XPath expression was valid"); |
michael@0 | 33 | |
michael@0 | 34 | // Cleanup. |
michael@0 | 35 | gBrowser.removeTab(tab2); |
michael@0 | 36 | gBrowser.removeTab(tab); |
michael@0 | 37 | }); |