зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 828008) for failing M(dt2) on Linux x64 debug and OS 10.6 debug and M-e10s(dt5) on Windows 7 debug. r=backout
Backed out changeset 426164db47c6 (bug 828008) Backed out changeset 6dbba51c24d2 (bug 828008) Backed out changeset 773075ac2210 (bug 828008)
This commit is contained in:
Родитель
b8755fbfbd
Коммит
7e18cc3c76
|
@ -18,9 +18,6 @@ responsiveUI.rotate2=Rotate
|
|||
# LOCALIZATION NOTE (responsiveUI.screenshot): tooltip of the screenshot button.
|
||||
responsiveUI.screenshot=Screenshot
|
||||
|
||||
# LOCALIZATION NOTE (responsiveUI.userAgentPlaceholder): placeholder for the user agent input.
|
||||
responsiveUI.userAgentPlaceholder=Custom User Agent
|
||||
|
||||
# LOCALIZATION NOTE (responsiveUI.screenshotGeneratedFilename): The auto generated filename.
|
||||
# The first argument (%1$S) is the date string in yyyy-mm-dd format and the second
|
||||
# argument (%2$S) is the time string in HH.MM.SS format.
|
||||
|
|
|
@ -7,23 +7,20 @@
|
|||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
var {require, loader} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var Services = require("Services");
|
||||
var {gDevTools} = require("resource://devtools/client/framework/gDevTools.jsm");
|
||||
var EventEmitter = require("devtools/shared/event-emitter");
|
||||
var {ViewHelpers} =
|
||||
require("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy",
|
||||
"resource://gre/modules/SystemAppProxy.jsm");
|
||||
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var Telemetry = require("devtools/client/shared/telemetry");
|
||||
var { showDoorhanger } = require("devtools/client/shared/doorhanger");
|
||||
var { TouchEventSimulator } = require("devtools/shared/touch/simulator");
|
||||
var { Task } = require("resource://gre/modules/Task.jsm");
|
||||
var promise = require("promise");
|
||||
loader.lazyImporter(this, "SystemAppProxy",
|
||||
"resource://gre/modules/SystemAppProxy.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerClient",
|
||||
"devtools/shared/client/main", true);
|
||||
loader.lazyRequireGetter(this, "DebuggerServer",
|
||||
"devtools/server/main", true);
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["ResponsiveUIManager"];
|
||||
|
||||
|
@ -212,7 +209,6 @@ function ResponsiveUI(aWindow, aTab)
|
|||
this.bound_startResizing = this.startResizing.bind(this);
|
||||
this.bound_stopResizing = this.stopResizing.bind(this);
|
||||
this.bound_onDrag = this.onDrag.bind(this);
|
||||
this.bound_changeUA = this.changeUA.bind(this);
|
||||
|
||||
// Events
|
||||
this.tab.addEventListener("TabClose", this);
|
||||
|
@ -241,8 +237,6 @@ function ResponsiveUI(aWindow, aTab)
|
|||
type: "deveditionpromo",
|
||||
anchor: this.chromeDoc.querySelector("#content")
|
||||
});
|
||||
|
||||
this.connectToServer();
|
||||
}
|
||||
|
||||
ResponsiveUI.prototype = {
|
||||
|
@ -259,27 +253,6 @@ ResponsiveUI.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
connectToServer: function() {
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
this.client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
this.client.connect(() => {
|
||||
this.client.getTab().then(({tab}) => {
|
||||
this.client.attachTab(tab.actor, (response, tabClient) => {
|
||||
if (!tabClient) {
|
||||
Cu.reportError("Responsive mode error: failed to attach tab");
|
||||
return;
|
||||
}
|
||||
this.tabClient = tabClient;
|
||||
this.userAgentInput.hidden = false;
|
||||
ResponsiveUIManager.emit("connectedToServer", { tab: this.tab });
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the nodes. Remove listeners. Reset the style.
|
||||
*/
|
||||
|
@ -331,7 +304,6 @@ ResponsiveUI.prototype = {
|
|||
if (this.touchEventSimulator) {
|
||||
this.touchEventSimulator.stop();
|
||||
}
|
||||
this.client.close();
|
||||
this._telemetry.toolClosed("responsive");
|
||||
let childOff = () => {
|
||||
this.mm.removeMessageListener("ResponsiveMode:Stop:Done", childOff);
|
||||
|
@ -485,14 +457,6 @@ ResponsiveUI.prototype = {
|
|||
|
||||
this.toolbar.appendChild(this.screenshotbutton);
|
||||
|
||||
this.userAgentInput = this.chromeDoc.createElement("textbox");
|
||||
this.userAgentInput.className = "devtools-responsiveui-textinput";
|
||||
this.userAgentInput.setAttribute("placeholder",
|
||||
this.strings.GetStringFromName("responsiveUI.userAgentPlaceholder"));
|
||||
this.userAgentInput.addEventListener("blur", this.bound_changeUA, true);
|
||||
this.userAgentInput.hidden = true;
|
||||
this.toolbar.appendChild(this.userAgentInput);
|
||||
|
||||
// Resizers
|
||||
let resizerTooltip = this.strings.GetStringFromName("responsiveUI.resizerTooltip");
|
||||
this.resizer = this.chromeDoc.createElement("box");
|
||||
|
@ -888,18 +852,6 @@ ResponsiveUI.prototype = {
|
|||
}
|
||||
}),
|
||||
|
||||
changeUA: function() {
|
||||
var value = this.userAgentInput.value;
|
||||
if (value !== "") {
|
||||
this.userAgentInput.setAttribute("attention", "true");
|
||||
} else {
|
||||
this.userAgentInput.removeAttribute("attention", "true");
|
||||
}
|
||||
this.tabClient.reconfigure({customUserAgent: value}, () => {
|
||||
ResponsiveUIManager.emit("userAgentChanged", { tab: this.tab });
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Change the size of the browser.
|
||||
*
|
||||
|
@ -1075,6 +1027,6 @@ ResponsiveUI.prototype = {
|
|||
},
|
||||
}
|
||||
|
||||
loader.lazyGetter(ResponsiveUI.prototype, "strings", function () {
|
||||
XPCOMUtils.defineLazyGetter(ResponsiveUI.prototype, "strings", function () {
|
||||
return Services.strings.createBundle("chrome://devtools/locale/responsiveUI.properties");
|
||||
});
|
||||
|
|
|
@ -13,4 +13,3 @@ skip-if = e10s && os == 'win'
|
|||
[browser_responsiveui_touch.js]
|
||||
[browser_responsiveuiaddcustompreset.js]
|
||||
[browser_responsive_devicewidth.js]
|
||||
[browser_responsiveui_customuseragent.js]
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const TEST_URI = "data:text/html, Custom User Agent test";
|
||||
const DEFAULT_UA = Cc["@mozilla.org/network/protocol;1?name=http"]
|
||||
.getService(Ci.nsIHttpProtocolHandler)
|
||||
.userAgent;
|
||||
const CHROME_UA = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36" +
|
||||
" (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36";
|
||||
add_task(function*() {
|
||||
yield addTab(TEST_URI);
|
||||
let mgr = ResponsiveUI.ResponsiveUIManager;
|
||||
let selectedTab = gBrowser.selectedTab;
|
||||
|
||||
let mgrOn = once(mgr, "connectedToServer");
|
||||
mgr.toggle(window, selectedTab);
|
||||
yield mgrOn;
|
||||
yield testUserAgent(DEFAULT_UA);
|
||||
|
||||
info("Setting UA to " + CHROME_UA);
|
||||
yield setUserAgent(CHROME_UA);
|
||||
yield testUserAgent(CHROME_UA);
|
||||
|
||||
info("Resetting UA");
|
||||
yield setUserAgent("");
|
||||
yield testUserAgent(DEFAULT_UA);
|
||||
|
||||
info("Setting UA to " + CHROME_UA);
|
||||
yield setUserAgent(CHROME_UA);
|
||||
yield testUserAgent(CHROME_UA);
|
||||
|
||||
info("Closing responsive mode");
|
||||
let mgrOff = once(mgr, "off");
|
||||
mgr.toggle(window, selectedTab);
|
||||
yield mgrOff;
|
||||
yield testUserAgent(DEFAULT_UA);
|
||||
});
|
||||
|
||||
function* setUserAgent(ua) {
|
||||
let mgr = ResponsiveUI.ResponsiveUIManager;
|
||||
let instance = mgr.getResponsiveUIForTab(gBrowser.selectedTab);
|
||||
let input = instance.userAgentInput;
|
||||
|
||||
input.focus();
|
||||
input.value = ua;
|
||||
let onUAChanged = once(mgr, "userAgentChanged");
|
||||
input.blur();
|
||||
yield onUAChanged;
|
||||
|
||||
if (ua !== "") {
|
||||
ok(input.hasAttribute("attention"), "UA input should be highlighted");
|
||||
} else {
|
||||
ok(!input.hasAttribute("attention"), "UA input shouldn't be highlighted");
|
||||
}
|
||||
}
|
||||
|
||||
function* testUserAgent(value) {
|
||||
let ua = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function*() {
|
||||
return content.navigator.userAgent;
|
||||
});
|
||||
is(ua, value, `UA should be set to ${value}`);
|
||||
}
|
|
@ -28,22 +28,6 @@
|
|||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
.devtools-responsiveui-textinput {
|
||||
-moz-appearance: none;
|
||||
background: #333;
|
||||
color: #fff;
|
||||
border: 1px solid #111;
|
||||
border-radius: 2px;
|
||||
padding: 5px;
|
||||
width: 200px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.devtools-responsiveui-textinput[attention] {
|
||||
border-color: #38ace6;
|
||||
background: rgba(56,172,230,0.4);
|
||||
}
|
||||
|
||||
.devtools-responsiveui-menulist,
|
||||
.devtools-responsiveui-toolbarbutton {
|
||||
-moz-appearance: none;
|
||||
|
|
Загрузка…
Ссылка в новой задаче