зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
030eb79e0d
Коммит
5ff757f31f
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче