Backed out changeset de77ab24fab9 (bug 1170011) for browser_viewSourceInTabOnViewSource.js failures.

This commit is contained in:
Ryan VanderMeulen 2015-08-25 23:16:22 -04:00
Родитель 7f46e67522
Коммит e304066dd1
5 изменённых файлов: 5 добавлений и 56 удалений

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

@ -382,7 +382,7 @@
label="&viewPageSourceCmd.label;"
accesskey="&viewPageSourceCmd.accesskey;"
oncommand="BrowserViewSource(gContextMenu.browser);"
observes="canViewSource"/>
observes="isImage"/>
<menuitem id="context-viewinfo"
label="&viewPageInfoCmd.label;"
accesskey="&viewPageInfoCmd.accesskey;"

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

@ -39,7 +39,7 @@
<commandset id="editMenuCommands"/>
<command id="View:PageSource" oncommand="BrowserViewSource(window.gBrowser.selectedBrowser);" observes="canViewSource"/>
<command id="View:PageSource" oncommand="BrowserViewSource(window.gBrowser.selectedBrowser);" observes="isImage"/>
<command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
<command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
<command id="View:ReaderView" oncommand="ReaderParent.toggleReaderMode(event);"/>
@ -174,7 +174,6 @@
oncommand="gPopupBlockerObserver.dontShowMessage();"/>
<broadcaster id="blockedPopupsSeparator"/>
<broadcaster id="isImage"/>
<broadcaster id="canViewSource"/>
<broadcaster id="isFrameImage"/>
<broadcaster id="singleFeedMenuitemState" disabled="true"/>
<broadcaster id="multipleFeedsMenuState" hidden="true"/>
@ -232,9 +231,7 @@
<broadcaster id="devtoolsMenuBroadcaster_PageSource"
label="&pageSourceCmd.label;"
key="key_viewSource"
command="View:PageSource">
<observes element="canViewSource" attribute="disabled"/>
</broadcaster>
command="View:PageSource"/>
<broadcaster id="devtoolsMenuBroadcaster_ErrorConsole"
label="&errorConsoleCmd.label;"
command="Tools:ErrorConsole"/>

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

@ -4049,10 +4049,6 @@ var XULBrowserWindow = {
delete this.isImage;
return this.isImage = document.getElementById("isImage");
},
get canViewSource () {
delete this.canViewSource;
return this.canViewSource = document.getElementById("canViewSource");
},
init: function () {
// Initialize the security button's state and tooltip text.
@ -4210,7 +4206,6 @@ var XULBrowserWindow = {
if (aRequest) {
let msg = "";
let location;
let canViewSource = true;
// Get the URI either from a channel or a pseudo-object
if (aRequest instanceof nsIChannel || "URI" in aRequest) {
location = aRequest.URI;
@ -4219,9 +4214,6 @@ var XULBrowserWindow = {
if (location.scheme == "keyword" && aWebProgress.isTopLevel)
gBrowser.userTypedValue = null;
canViewSource = !Services.prefs.getBoolPref("view_source.tab") ||
location.scheme != "view-source";
if (location.spec != "about:blank") {
switch (aStatus) {
case Components.results.NS_ERROR_NET_TIMEOUT:
@ -4235,18 +4227,10 @@ var XULBrowserWindow = {
this.setDefaultStatus(msg);
// Disable menu entries for images, enable otherwise
if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType)) {
if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType))
this.isImage.removeAttribute('disabled');
} else {
canViewSource = false;
else
this.isImage.setAttribute('disabled', 'true');
}
if (canViewSource) {
this.canViewSource.removeAttribute('disabled');
} else {
this.canViewSource.setAttribute('disabled', 'true');
}
}
this.isBusy = false;

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

@ -475,7 +475,6 @@ skip-if = os == "linux" || e10s # Bug 1073339 - Investigate autocomplete test un
[browser_urlbar_search_healthreport.js]
[browser_urlbar_searchsettings.js]
[browser_utilityOverlay.js]
[browser_viewSourceInTabOnViewSource.js]
[browser_visibleFindSelection.js]
[browser_visibleLabel.js]
[browser_visibleTabs.js]

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

@ -1,31 +0,0 @@
add_task(function*() {
yield new Promise((resolve) => {
SpecialPowers.pushPrefEnv({"set": [
["view_source.tab", true],
]}, resolve);
});
});
add_task(function* test_regular_page() {
function* test_expect_view_source_enabled(browser) {
ok(!XULBrowserWindow.canViewSource.hasAttribute("disabled"),
"View Source should be enabled");
}
yield BrowserTestUtils.withNewTab({
gBrowser,
url: "http://example.com",
}, test_expect_view_source_enabled);
});
add_task(function* test_view_source_page() {
function* test_expect_view_source_disabled(browser) {
ok(XULBrowserWindow.canViewSource.hasAttribute("disabled"),
"View Source should be disabled");
}
yield BrowserTestUtils.withNewTab({
gBrowser,
url: "view-source:http://example.com",
}, test_expect_view_source_disabled);
});