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 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | function test() { |
michael@0 | 6 | waitForExplicitFinish(); |
michael@0 | 7 | |
michael@0 | 8 | gBrowser.selectedTab = gBrowser.addTab(); |
michael@0 | 9 | registerCleanupFunction(function() { |
michael@0 | 10 | gBrowser.removeCurrentTab(); |
michael@0 | 11 | }); |
michael@0 | 12 | const TEST_URL = "http://mochi.test:8888/notFoundPage.html"; |
michael@0 | 13 | // Used to verify errors are not marked as typed. |
michael@0 | 14 | PlacesUtils.history.markPageAsTyped(NetUtil.newURI(TEST_URL)); |
michael@0 | 15 | gBrowser.selectedTab.linkedBrowser.loadURI(TEST_URL); |
michael@0 | 16 | |
michael@0 | 17 | // Create and add history observer. |
michael@0 | 18 | let historyObserver = { |
michael@0 | 19 | onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID, |
michael@0 | 20 | aTransitionType) { |
michael@0 | 21 | PlacesUtils.history.removeObserver(historyObserver); |
michael@0 | 22 | info("Received onVisit: " + aURI.spec); |
michael@0 | 23 | fieldForUrl(aURI, "frecency", function (aFrecency) { |
michael@0 | 24 | is(aFrecency, 0, "Frecency should be 0"); |
michael@0 | 25 | fieldForUrl(aURI, "hidden", function (aHidden) { |
michael@0 | 26 | is(aHidden, 0, "Page should not be hidden"); |
michael@0 | 27 | fieldForUrl(aURI, "typed", function (aTyped) { |
michael@0 | 28 | is(aTyped, 0, "page should not be marked as typed"); |
michael@0 | 29 | promiseClearHistory().then(finish); |
michael@0 | 30 | }); |
michael@0 | 31 | }); |
michael@0 | 32 | }); |
michael@0 | 33 | }, |
michael@0 | 34 | onBeginUpdateBatch: function () {}, |
michael@0 | 35 | onEndUpdateBatch: function () {}, |
michael@0 | 36 | onTitleChanged: function () {}, |
michael@0 | 37 | onDeleteURI: function () {}, |
michael@0 | 38 | onClearHistory: function () {}, |
michael@0 | 39 | onPageChanged: function () {}, |
michael@0 | 40 | onDeleteVisits: function () {}, |
michael@0 | 41 | QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]) |
michael@0 | 42 | }; |
michael@0 | 43 | PlacesUtils.history.addObserver(historyObserver, false); |
michael@0 | 44 | } |