Bug 599969 - Do not use steps for async visit adding

Part 6 - Do not add javascript URIs for history (trunk is already doing this,
and the Places branch was getting assertions because GetReversedHostname would
fail on the background thread which would cause nsJSURI to be released off of
the main thread, which is bad).
r=mak
r=ehsan
This commit is contained in:
Shawn Wilsher 2010-11-09 11:43:18 -08:00
Родитель 030eb79e0d
Коммит 5ff757f31f
5 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -64,6 +64,7 @@ _BROWSER_TEST_FILES = \
browser_library_views_liveupdate.js \
browser_views_liveupdate.js \
browser_sidebarpanels_click.js \
sidebarpanels_click_test_page.html \
browser_library_infoBox.js \
$(NULL)

Просмотреть файл

@ -59,7 +59,7 @@ function test() {
toggleSidebar();
}
const TEST_URL = "javascript:alert(\"test\");";
const TEST_URL = "http://mochi.test:8888/browser/browser/components/places/tests/browser/sidebarpanels_click_test_page.html";
let tests = [];
tests.push({
@ -87,8 +87,10 @@ function test() {
init: function() {
// Add a history entry.
this.cleanup();
hs.addVisit(PlacesUtils._uri(TEST_URL), Date.now() * 1000,
null, hs.TRANSITION_TYPED, false, 0);
let uri = PlacesUtils._uri(TEST_URL);
hs.addVisit(uri, Date.now() * 1000, null, hs.TRANSITION_TYPED, false, 0);
let gh = hs.QueryInterface(Ci.nsIGlobalHistory2);
ok(gh.isVisited(uri), "Item is visited");
},
prepare: function() {
sidebar.contentDocument.getElementById("byvisited").doCommand();

Просмотреть файл

@ -0,0 +1,7 @@
<html>
<head>
<title>browser_sidebarpanels_click.js test page</title>
</head>
<body onload="alert('test');">
</body>
</html>

Просмотреть файл

@ -2691,7 +2691,8 @@ nsNavHistory::CanAddURI(nsIURI* aURI, PRBool* canAdd)
scheme.EqualsLiteral("view-source") ||
scheme.EqualsLiteral("chrome") ||
scheme.EqualsLiteral("data") ||
scheme.EqualsLiteral("wyciwyg")) {
scheme.EqualsLiteral("wyciwyg") ||
scheme.EqualsLiteral("javascript")) {
*canAdd = PR_FALSE;
return NS_OK;
}

Просмотреть файл

@ -49,7 +49,8 @@ let kTitles = [
];
addPageBook(0, 0); // regular url
addPageBook(1, 0); // javascript: uri
// javascript: uri as bookmark (no visit)
addPageBook(1, 0, 0, undefined, undefined, undefined, true);
// Provide for each test: description; search terms; array of gPages indices of
// pages that should match; optional function to be run before the test